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

GitHub alert block quotes #118

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"markdown-it-deflist": "^3.0.0",
"markdown-it-emoji": "^3.0.0",
"markdown-it-footnote": "^4.0.0",
"markdown-it-github-alerts": "^0.3.0",
"markdown-it-inject-linenumbers": "^0.3.0",
"markdown-it-mark": "^4.0.0",
"markdown-it-sub": "^2.0.0",
Expand Down
3 changes: 3 additions & 0 deletions src/parser/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ mdit.use(attributes);

// MARK: untyped plugins done

import githubAlerts from 'markdown-it-github-alerts';
mdit.use(githubAlerts);

// anchor has to be added after attribute plugin for ids to work
mdit.use(anchor, {
permalink: anchor.permalink.ariaHidden({
Expand Down
17 changes: 17 additions & 0 deletions tests/markdown-additional.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,20 @@ Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy, and <kbd>Ctrl</kbd> + <kbd>V</kbd>
## Custom attributes

This paragraph has a red background color.{style=background-color:red}

## Github alert blockquote

> [!NOTE]
> Something to take into account

> [!TIP]
> Did you know you can do this and that

> [!IMPORTANT]
> Crucial information here

> [!WARNING]
> Critical content demanding immediate attention

> [!CAUTION]
> Do not do this and that!
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,11 @@ markdown-it-footnote@^4.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-4.0.0.tgz#02ede0cb68a42d7e7774c3abdc72d77aaa24c531"
integrity sha512-WYJ7urf+khJYl3DqofQpYfEYkZKbmXmwxQV8c8mO/hGIhgZ1wOe7R4HLFNwqx7TjILbnC98fuyeSsin19JdFcQ==

markdown-it-github-alerts@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/markdown-it-github-alerts/-/markdown-it-github-alerts-0.3.0.tgz#acab7db57f4e204c8d1c987403c367738d7026b0"
integrity sha512-qyIuDyfdrVGHhY+E/44yMyNA3ZnayaT/KKT2VgkIz1nmrgiuPkdgPUh4YBZwgJ9VKEGJvGd82Ndrc4oGftrJWg==

markdown-it-inject-linenumbers@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/markdown-it-inject-linenumbers/-/markdown-it-inject-linenumbers-0.3.0.tgz#654364fa7a2dcb5f4461ef6d29d2603b74b29fd7"
Expand Down