|
|
|
|
@ -18,6 +18,19 @@ export interface ContainerPluginOptions {
|
|
|
|
|
locales?: Record<string, MarkdownLocaleOptions | undefined>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const containerLabels = [
|
|
|
|
|
['tip', 'tipLabel', 'TIP'],
|
|
|
|
|
['info', 'infoLabel', 'INFO'],
|
|
|
|
|
['warning', 'warningLabel', 'WARNING'],
|
|
|
|
|
['danger', 'dangerLabel', 'DANGER'],
|
|
|
|
|
['details', 'detailsLabel', 'Details'],
|
|
|
|
|
['note', 'noteLabel', 'NOTE'],
|
|
|
|
|
['important', 'importantLabel', 'IMPORTANT'],
|
|
|
|
|
['caution', 'cautionLabel', 'CAUTION']
|
|
|
|
|
] as const
|
|
|
|
|
|
|
|
|
|
const alertMarkerRE = /^\[!([\w-]+)\]([^\n\r]*)/
|
|
|
|
|
|
|
|
|
|
export const containerPlugin = (
|
|
|
|
|
md: MarkdownItAsync,
|
|
|
|
|
options?: ContainerOptions,
|
|
|
|
|
@ -64,17 +77,6 @@ function titlesFor(
|
|
|
|
|
return (localeIndex && titles.byLocale[localeIndex]) || titles.base
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const containerLabels = [
|
|
|
|
|
['tip', 'tipLabel', 'TIP'],
|
|
|
|
|
['info', 'infoLabel', 'INFO'],
|
|
|
|
|
['warning', 'warningLabel', 'WARNING'],
|
|
|
|
|
['danger', 'dangerLabel', 'DANGER'],
|
|
|
|
|
['details', 'detailsLabel', 'Details'],
|
|
|
|
|
['note', 'noteLabel', 'NOTE'],
|
|
|
|
|
['important', 'importantLabel', 'IMPORTANT'],
|
|
|
|
|
['caution', 'cautionLabel', 'CAUTION']
|
|
|
|
|
] as const
|
|
|
|
|
|
|
|
|
|
function resolveTitlesByLocale(
|
|
|
|
|
options?: ContainerOptions,
|
|
|
|
|
locales?: Record<string, MarkdownLocaleOptions | undefined>
|
|
|
|
|
@ -185,8 +187,6 @@ function createCodeGroupOpenRender(md: MarkdownItAsync): RenderRule {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const alertMarkerRE = /^\[!([\w-]+)\]([^\n\r]*)/
|
|
|
|
|
|
|
|
|
|
export const gitHubAlertsPlugin = (
|
|
|
|
|
md: MarkdownItAsync,
|
|
|
|
|
options?: ContainerOptions,
|
|
|
|
|
|