Files
outline/shared/editor/rules/notices.ts
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00

22 lines
577 B
TypeScript

import type { Token } from "markdown-it";
import type MarkdownIt 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";
}
},
});
}