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

feat(NcRichText) add support of GFM (extended markdown) #4365

Merged
merged 3 commits into from Jan 23, 2024

Conversation

Antreesy
Copy link
Contributor

@Antreesy Antreesy commented Jul 26, 2023

☑️ Resolves

  • Add package remark-gfm for further support of:
    • autolink literals
    • footnotes ??
    • strikethrough ~~
    • tables -- | --
    • tasklists - [ ] - [x]
  • parsed text was hacked to insert non-breaking space between each two new lines. Thus span which rendered for a new line, have both width and height parameters, and is visible in the window

🖼️ Screenshots

image

markdown-checkboxes.webm

In Talk messages:
image

🚧 Tasks

  • ...

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable

@Antreesy Antreesy added enhancement New feature or request 3. to review Waiting for reviews dependencies Pull requests that update a dependency file feature: richtext Related to the richtext component labels Jul 26, 2023
@Antreesy Antreesy added this to the 8.0.0 milestone Jul 26, 2023
@Antreesy Antreesy self-assigned this Jul 26, 2023
@susnux
Copy link
Contributor

susnux commented Aug 7, 2023

One thing I am not sure about is whether we want to different Markdown flavors, as this can be quite confusing.
So on the one side we would have the text and collectives apps running on CommonMark + Extensions and on the other side Talk.

Maybe we should make sure NcRichText and Text supports the same Markdown dialect?

@Antreesy
Copy link
Contributor Author

Antreesy commented Aug 7, 2023

Maybe we should make sure NcRichText and Text supports the same Markdown dialect?

That could be the best way to do that.

@susnux susnux modified the milestones: 8.0.0, 8.1.0 Nov 8, 2023
@AndyScherzinger AndyScherzinger modified the milestones: 8.1.0, 8.1.1 Nov 14, 2023
@susnux susnux modified the milestones: 8.1.1, 8.2.0 Nov 14, 2023
@susnux susnux modified the milestones: 8.3.0, 8.4.0 Dec 1, 2023
@ShGKme ShGKme modified the milestones: 8.4.0, 8.5.0 Dec 27, 2023
@Antreesy
Copy link
Contributor Author

Link to documentation:

So, GFM is based on CMS, including such extensions as autolink, strikethrough, tables and tasklists. I see they're activated in Text app as well: https://github.com/nextcloud/text/blob/cd39a0decac0a6f003d4bddff22faa70c3e71ae5/src/markdownit/index.js#L13-L16

From that point, flavor would be the same, although we might need to align syntax for some extensions (and not sure this make sense for the tables, as Text has injected table editor, which would be an overkill for Talk input)

To ensure we're supporting the same syntax, we could try to base NcRichText tests on https://spec.commonmark.org/0.30/spec.json somehow, but I don't think it's needed, as libraries based on the same specs

@Antreesy Antreesy force-pushed the feat/noid/support-github-markdown branch from 479ed3b to e5d0269 Compare January 18, 2024 19:25
@Antreesy Antreesy changed the base branch from master to next January 18, 2024 19:25
@Antreesy Antreesy marked this pull request as draft January 18, 2024 19:39
@Antreesy
Copy link
Contributor Author

Because of using some React functionality at master branch to create nodes, I had troubles with passing an event from rendered checkbox to parent. Will make another attempt

Apart from it, a basic extended markdown is working and evem possible to backport for master release, although I don't know, if it's considered as breaking change or not (original behavior was untouched, this goes under new functionality)

@Antreesy Antreesy marked this pull request as ready for review January 22, 2024 15:15
@raimund-schluessler

This comment was marked as outdated.

@Antreesy

This comment was marked as outdated.

@Antreesy Antreesy force-pushed the feat/noid/support-github-markdown branch from d0bd807 to 42cb82e Compare January 22, 2024 16:38
@Antreesy Antreesy changed the base branch from next to master January 22, 2024 16:38
@Antreesy Antreesy mentioned this pull request Jan 23, 2024
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Cool, seems to work fine. Some comments

src/components/NcRichText/autolink.js Outdated Show resolved Hide resolved
src/components/NcRichText/NcRichText.vue Outdated Show resolved Hide resolved
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy force-pushed the feat/noid/support-github-markdown branch from dffa03a to ce2389d Compare January 23, 2024 17:54
@Antreesy Antreesy merged commit a53dcda into master Jan 23, 2024
15 checks passed
@Antreesy Antreesy deleted the feat/noid/support-github-markdown branch January 23, 2024 17:57
@Antreesy
Copy link
Contributor Author

Aj, we forgot to put it into the 8.5.0 changelog 🙈

@Pytal Pytal removed the dependencies Pull requests that update a dependency file label Jan 23, 2024
@Pytal
Copy link
Contributor

Pytal commented Jan 23, 2024

🙈 sorry, looks like this one was excluded by our config

- dependencies
because of the dependencies label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: richtext Related to the richtext component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants