diff --git a/src/node/markdown/plugins/containers.ts b/src/node/markdown/plugins/containers.ts
index 5008850b..6fa86b73 100644
--- a/src/node/markdown/plugins/containers.ts
+++ b/src/node/markdown/plugins/containers.ts
@@ -14,34 +14,27 @@ export const containerPlugin = (
options: Options,
containerOptions?: ContainerOptions
) => {
- md.use(...createContainer('tip', containerOptions?.tipLabel || 'TIP', md))
- .use(...createContainer('info', containerOptions?.infoLabel || 'INFO', md))
- .use(
- ...createContainer(
- 'warning',
- containerOptions?.warningLabel || 'WARNING',
- md
- )
- )
- .use(
- ...createContainer(
- 'danger',
- containerOptions?.dangerLabel || 'DANGER',
- md
- )
- )
- .use(
- ...createContainer(
- 'details',
- containerOptions?.detailsLabel || 'Details',
- md
- )
- )
- // explicitly escape Vue syntax
- .use(container, 'v-pre', {
- render: (tokens: Token[], idx: number) =>
- tokens[idx].nesting === 1 ? `
\n` : `
\n`
- })
+ const defaultContainers = {
+ tip: containerOptions?.tipLabel ?? 'TIP',
+ info: containerOptions?.infoLabel ?? 'INFO',
+ warning: containerOptions?.warningLabel ?? 'WARNING',
+ danger: containerOptions?.dangerLabel ?? 'DANGER',
+ details: containerOptions?.detailsLabel ?? 'Details'
+ }
+ const containers: Record = {
+ ...defaultContainers,
+ ...(containerOptions?.customContainers ?? {})
+ }
+
+ Object.entries(containers).forEach(([key, value]) => {
+ md.use(...createContainer(key, value, md))
+ })
+
+ // explicitly escape Vue syntax
+ md.use(container, 'v-pre', {
+ render: (tokens: Token[], idx: number) =>
+ tokens[idx].nesting === 1 ? `\n` : `
\n`
+ })
.use(container, 'raw', {
render: (tokens: Token[], idx: number) =>
tokens[idx].nesting === 1 ? `\n` : `
\n`
@@ -136,4 +129,5 @@ export interface ContainerOptions {
detailsLabel?: string
importantLabel?: string
cautionLabel?: string
+ customContainers?: Record
}