Skip to content

Enhancement: Update GitHub Flavored Markdown parser to support "Alerts" syntax #45907

@aduth

Description

@aduth

Impacted plugin

None / Other

What

Update GitHub Flavored Markdown parser to support "Alerts" syntax

How

GitHub now extends Markdown syntax to support showing alerts, which would be nice to support as part of the WPCom_GHF_Markdown_Parser class.

Documentation: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts

Examples:

Note

Useful information that users should know, even when skimming content.

Tip

Helpful advice for doing things better or more easily.

Important

Key information users need to know to achieve their goal.

Warning

Urgent info that needs immediate user attention to avoid problems.

Caution

Advises about risks or negative outcomes of certain actions.

Syntax Reference:

> [!NOTE]
> Useful information that users should know, even when skimming content.

> [!TIP]
> Helpful advice for doing things better or more easily.

> [!IMPORTANT]
> Key information users need to know to achieve their goal.

> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.

> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.

Use-Case:

Documentation on the WordPress Developer Resources site uses this parser class to parse Markdown shown on the site, for example from documentation authored in the Gutenberg plugin. Without support for this feature, it is difficult to author documentation which would consistently show alert content in both GitHub and the developer site.

Examples:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions