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

Add a multiline blockquote extension #359

Merged
merged 5 commits into from
Jan 24, 2024

Conversation

digitalmoksha
Copy link
Collaborator

Adds the ability to enclose multiple lines in a blockquote. Such as:

>>>
Paragraph one

Paragraph two
>>>

This is part of the GitLab Flavored Markdown (GLFM) specification, https://docs.gitlab.com/ee/user/markdown.html#multiline-blockquote

@digitalmoksha
Copy link
Collaborator Author

I still need to add an extension flag (right now it's fully hooked in).

And does it make sense make it a compile feature?

@kivikakk what do you think, would this be something that could be incorporated?

@digitalmoksha digitalmoksha force-pushed the bw-multiline-blockquote branch from b5789b1 to 9992e51 Compare January 23, 2024 22:32
Adds the ability to enclose multiple lines in a blockquote.
Such as:

>>>
Paragraph one

Paragraph two
>>>
@digitalmoksha digitalmoksha force-pushed the bw-multiline-blockquote branch from 9992e51 to c8c518d Compare January 23, 2024 22:33
Copy link
Owner

@kivikakk kivikakk left a comment

Choose a reason for hiding this comment

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

This looks awesome!

@digitalmoksha yes, I think we should definitely include this! I'd be inclined not to compile flag it, I think it's a handy option to have and there are increasingly Markdown dialects/input elements that support this syntax; no need to restrict it imo.

Let me know when you're done and I'll throw fuzzers at it for a while :)

src/nodes.rs Outdated Show resolved Hide resolved
src/tests/api.rs Outdated Show resolved Hide resolved
src/parser/multiline_block_quote.rs Outdated Show resolved Hide resolved
src/cm.rs Show resolved Hide resolved
@digitalmoksha
Copy link
Collaborator Author

there are increasingly Markdown dialects/input elements that support this syntax

Really, I wasn't aware of any. Do you have an example?

@kivikakk
Copy link
Owner

The one that comes to mind for me immediately is Discord: entering >>> at the start of a line will make the entire rest of the message fall under that blockquote. (There's no way to end it before the end of the message iirc. This behaviour only functions on mobile; on desktop the WYSIWYG editor takes over and produces the same effect.)

IIRC one or both of Slack and Mattermost also recognise this syntax, and I've seen people actually try it out elsewhere where it isn't supported!

@gjtorikian
Copy link
Collaborator

IIRC one or both of Slack and Mattermost also recognise this syntax

FWIW, Slack for sure supports it.

@digitalmoksha
Copy link
Collaborator Author

It looks Slack is the same as Discord, you can't turn off the block quote (at least I wasn't able to). You can't bracket it like a fenced code block.

@kivikakk
Copy link
Owner

Yep, indeed! They don't share that aspect of it, but it's similar and intuitive enough (imo).

@digitalmoksha
Copy link
Collaborator Author

I made the suggested changes and added the extension option multline-block-quotes

I think it's ready for final review.

Copy link
Owner

@kivikakk kivikakk left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you so much, @digitalmoksha! ❤️ :shipit:

I'm going to run fuzzing on this for a few hours, and merge when done.

@digitalmoksha digitalmoksha changed the title Add a multline blockquote extension Add a multiline blockquote extension Jan 24, 2024
@kivikakk kivikakk merged commit ba5b1e1 into kivikakk:main Jan 24, 2024
12 checks passed
@digitalmoksha digitalmoksha deleted the bw-multiline-blockquote branch January 24, 2024 05:19
@digitalmoksha
Copy link
Collaborator Author

Thanks for merging @kivikakk 🙇

@digitalmoksha
Copy link
Collaborator Author

@kivikakk when you have time, would it be possible to cut a new release?

@kivikakk
Copy link
Owner

kivikakk commented Jan 25, 2024 via email

@kivikakk
Copy link
Owner

comrak 0.21.0 is now on crates.io! Thanks for your hard work, @digitalmoksha ❤️

@digitalmoksha
Copy link
Collaborator Author

Thank you @kivikakk! I've updated my dingus, it's working like a charm. https://gitlab-org.gitlab.io/ruby/gems/gitlab-glfm-markdown/

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

Successfully merging this pull request may close these issues.

3 participants