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

Enable GitLab multiline alerts #521

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Enable GitLab multiline alerts #521

merged 1 commit into from
Jan 21, 2025

Conversation

digitalmoksha
Copy link
Collaborator

When the extensions alerts and multiline-block-quotes are enabled, then we now recognize GitLab style multiline alerts. For example

>>> [!note]
Something of interest.

And another thing...
>>>

will behave the same as

> [!note]
> Something of interest.
>
> And another thing...

This makes it easier to make an alert out of multiple paragraphs and blocks, in the same fashion as GitLab multiline block quotes

@digitalmoksha digitalmoksha self-assigned this Jan 20, 2025
Copy link
Contributor

Command Mean [ms] Min [ms] Max [ms] Relative
./bench.sh ./comrak-0cda031 318.4 ± 2.4 315.6 324.4 2.92 ± 0.03
./bench.sh ./comrak-main 319.3 ± 4.5 315.4 335.2 2.93 ± 0.05
./bench.sh ./pulldown-cmark 109.1 ± 1.0 107.9 111.2 1.00
./bench.sh ./cmark-gfm 115.0 ± 1.7 112.2 117.7 1.05 ± 0.02
./bench.sh ./markdown-it 480.0 ± 4.3 475.2 490.8 4.40 ± 0.06

Run on Mon Jan 20 21:31:57 UTC 2025

@kivikakk
Copy link
Owner

Looking good! Have run fuzzing for a bit and will continue to do so, but I'm happy if you're happy. :)

@digitalmoksha
Copy link
Collaborator Author

Yeah I feel good about. Also ran fuzzing for a couple hours 👍

So I'll merge. Maybe we can cut a release whenever you have some time.

@digitalmoksha digitalmoksha merged commit 0134275 into main Jan 21, 2025
39 checks passed
@digitalmoksha digitalmoksha deleted the bw-mulitline-alert branch January 21, 2025 01:10
@charlottia
Copy link
Collaborator

Will make one tonight or tomorrow! :)

@charlottia
Copy link
Collaborator

Done! https://github.com/kivikakk/comrak/releases/tag/v0.34.0

@digitalmoksha
Copy link
Collaborator Author

Thanks! 🙇‍♂️

mfontanini added a commit to mfontanini/presenterm that referenced this pull request Jan 23, 2025
This adds supports for markdown alerts (github/gitlab style) as support
for these was recently added to comrak. This for now looks close a block
quote except it also contains a title colored the same color as the
vertical bar prefix that shows up on the left of the block quote.

See kivikakk/comrak#519 and
kivikakk/comrak#521 for syntax but basically
this:

```markdown
> [!note]
> this is a note

> [!tip]
> this is a tip

> [!important]
> this is important

> [!warning]
> this is warning!

> [!caution]
> this advises caution!

>>> [!note] other title
ez
multiline
>>>
```

Renders like this:


![image](https://github.com/user-attachments/assets/219024ae-b635-4bf2-87ba-e252b64ebd67)
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