mirror of
https://github.com/outline/outline.git
synced 2026-02-15 15:29:02 -06:00
* chore(deps): bump prosemirror-markdown from 1.13.0 to 1.13.1 Bumps [prosemirror-markdown](https://github.com/prosemirror/prosemirror-markdown) from 1.13.0 to 1.13.1. - [Changelog](https://github.com/ProseMirror/prosemirror-markdown/blob/master/CHANGELOG.md) - [Commits](https://github.com/prosemirror/prosemirror-markdown/compare/1.13.0...1.13.1) --- updated-dependencies: - dependency-name: prosemirror-markdown dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * tsc --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom.moor@gmail.com>
21 lines
541 B
TypeScript
21 lines
541 B
TypeScript
import MarkdownIt, { Token } from "markdown-it";
|
|
import customFence from "markdown-it-container";
|
|
|
|
export default function notice(md: MarkdownIt): void {
|
|
return customFence(md, "notice", {
|
|
marker: ":",
|
|
validate: () => true,
|
|
render(tokens: Token[], idx: number) {
|
|
const { info } = tokens[idx];
|
|
|
|
if (tokens[idx].nesting === 1) {
|
|
// opening tag
|
|
return `<div class="notice notice-${md.utils.escapeHtml(info)}">\n`;
|
|
} else {
|
|
// closing tag
|
|
return "</div>\n";
|
|
}
|
|
},
|
|
});
|
|
}
|