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

Markdown support #1299

Closed
8 of 10 tasks
Tracked by #1027
nickvergessen opened this issue Jul 11, 2023 · 4 comments · Fixed by #1328
Closed
8 of 10 tasks
Tracked by #1027

Markdown support #1299

nickvergessen opened this issue Jul 11, 2023 · 4 comments · Fixed by #1328

Comments

@nickvergessen
Copy link
Member

nickvergessen commented Jul 11, 2023

We plan to role out the following support for markdown:

non-optional

  • bold
  • italic

optional

Optional means it is just shown with the markdown syntax

  • strike-through
  • list
  • todo list with checkboxes
  • code block using 3 `
  • inline code using `
  • quote
  • headlines
  • dividers ---
@SystemKeeper
Copy link
Collaborator

SystemKeeper commented Jul 12, 2023

Some research on this.

Apple native markdown implementation:

  • bold
  • italic
  • strike-through
  • list
  • todo list with checkboxes
  • code block using 3 ` (partially, is parsed as markdown, but removes newlines inside the 3 ` which renders it useless)
  • inline code using `
  • quote
  • headlines
  • dividers ---

👍 Native
👎 Hard to customize
👎 no newlines inside of the 3 ` renders it useless in my opinion

Down library https://github.com/johnxnguyen/Down

CDMarkdownKit https://github.com/chrisdhaan/CDMarkdownKit

  • bold
  • italic
  • strike-through
  • list (no sublists)
  • todo list with checkboxes
  • code block using 3 `
  • inline code using `
  • quote
  • headlines
  • dividers --- (Could possibly be added through custom syntax addition)

👍 Very easy to customize appearance
👎 Need to research missing indentation, spaces at the beginning of a line are removed

Comment

  • All 3 ways can parse a NSString to a NSAttributedString, so switching between the 3 ways is easy
  • Set up a test with all 3 ways, was very easy in all cases
  • CDMarkdownKit is very easily customizable

@SystemKeeper
Copy link
Collaborator

👎 Need to research missing indentation, spaces at the beginning of a line are removed

Works by removing
https://github.com/chrisdhaan/CDMarkdownKit/blob/b08981016f9406eb6d18150a3c8caa4288983d2e/Source/CDMarkdownParser.swift#L191-L199

So we could change this locally and provide a patch upstream.

@SystemKeeper
Copy link
Collaborator

Done in #1296

@SystemKeeper SystemKeeper self-assigned this Jul 24, 2023
@nickvergessen
Copy link
Member Author

There is a markdown property on messages now. If that is false, all Markdown rendering should be disabled:
nextcloud/spreed#10067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants