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

fix(markdown): Fix GFM rendering if blank line right after magic keyword #11108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

queengooborg
Copy link
Collaborator

Summary

This PR is a follow-up to #10168, which fixes the rendering of GFM noteblocks if there is a blank line after the magic keyword (which is required for callouts due to Prettier formatting).

Problem

See summary

Solution

The solution is simple: update the regex to remove the magic keyword from rendering to make the newline character afterwards optional, since a blank line in between the magic keyword and content generates multiple paragraphs instead of a newline character. Afterwards, any preceding blank lines are stripped for pretty rendering.


Screenshots

Test Markdown used:

> [!NOTE]
> Hello!

> [!WARNING]
> Hello!

> [!CALLOUT]
> Hello!

---

> [!NOTE]
>
> Hello!

> [!WARNING]
>
> Hello!

> [!CALLOUT]
>
> Hello!

Before

Screenshot 2024-05-11 at 17 28 32

After

Screenshot 2024-05-11 at 17 28 48

@queengooborg queengooborg requested a review from a team as a code owner May 12, 2024 00:32
@github-actions github-actions bot added the markdown markdown related issues and pull requests label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markdown markdown related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant