-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Update Markdown in MDN docs to use GFM syntax #33384
Conversation
files/en-us/mdn/writing_guidelines/howto/markdown_in_mdn/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/howto/markdown_in_mdn/index.md
Outdated
Show resolved
Hide resolved
> [!CALLOUT] | ||
> **This is how you write a callout.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
> [!CALLOUT] | |
> **This is how you write a callout.** | |
> [!CALLOUT] > **This is how you write a callout.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh, that's not proper!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A markdownlint rule kicking in here, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to change this in mdlint config:
"no-blanks-blockquote": true,
edit: https://github.com/DavidAnson/markdownlint/blob/main/doc/md028.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although disabling this rule and running yarn run lint:md
you get:
Linting: 12280 file(s)
Summary: 244 error(s)
Which is what the mdlint config comment says (consecutive admonitions) so this breaks:
> [!Note]
> The above behavior of block layout changes if ...
> [!Note]
> HTML (_HyperText Markup Language_) elements ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe I'm wrong, is it just happening with Callouts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that prettier caused this problem, see playground, issue: prettier/prettier#9099
A workaround to resolve this:
> [!CALLOUT]
>
> **This is how you write a callout.**
maybe we need to resolve the wrong parser logic of yari (as this could not be rendered correctly by yari)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just submitted mdn/yari#11108 to fix the rendering!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted 👍🏻
files/en-us/mdn/writing_guidelines/howto/markdown_in_mdn/index.md
Outdated
Show resolved
Hide resolved
Preview URLs External URLs (1)URL:
(comment last updated: 2024-07-23 12:30:47) |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Removing myself from review for the moment. Please re-add me when it's ready for a look 🙌🏻 |
This is now unblocked :) |
files/en-us/mdn/writing_guidelines/howto/markdown_in_mdn/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mdn/writing_guidelines/howto/markdown_in_mdn/index.md
Outdated
Show resolved
Hide resolved
@@ -257,38 +267,19 @@ This will produce the following HTML: | |||
|
|||
This HTML will be rendered as a highlighted box: | |||
|
|||
> **Callout:** | |||
> [!CALLOUT] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks fine, but this still looks broken on the preview, are we waiting for a Yari version to land in the content repo for this or what's the plan? Otherwise looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preview looks broken because it's running a version of Yari prior to the bug fix, which isn't yet released. We can probably merge this now and then it'll automatically be fixed once Yari's been updated, but WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just on this page, right? If it's only one occurrence, which it looks like, it's probably fine to land this. Other instances (137 cases) use the older syntax:
grep -r "\*\*Callout:\*\*" ./files | wc -l
137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, it's just this one, yeah!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Going to leave a +1 so we can merge when you're ready. The template page may look odd until the latest Yari gets pulled in, but we can keep an eye on it.
Description
This PR updates the section about notes, warnings and callouts in the Markdown in MDN page to reflect the new GFM syntax.
Motivation
mdn/yari#10168 was just merged!
Depends on mdn/yari#11108.