diff --git a/server/modules/rendering/markdown-github-alerts/definition.yml b/server/modules/rendering/markdown-github-alerts/definition.yml index 26de5a7a..987be42b 100644 --- a/server/modules/rendering/markdown-github-alerts/definition.yml +++ b/server/modules/rendering/markdown-github-alerts/definition.yml @@ -6,45 +6,10 @@ icon: mdi-alert-box-outline enabledDefault: true dependsOn: markdownCore props: - enableNoteAlert: - type: Boolean - default: true - title: Enable NOTE alerts - hint: Support for > [!NOTE] syntax - order: 1 - public: true - enableTipAlert: - type: Boolean - default: true - title: Enable TIP alerts - hint: Support for > [!TIP] syntax - order: 2 - public: true - enableWarningAlert: - type: Boolean - default: true - title: Enable WARNING alerts - hint: Support for > [!WARNING] syntax - order: 3 - public: true - enableImportantAlert: - type: Boolean - default: true - title: Enable IMPORTANT alerts - hint: Support for > [!IMPORTANT] syntax - order: 4 - public: true - enableCautionAlert: - type: Boolean - default: true - title: Enable CAUTION alerts - hint: Support for > [!CAUTION] syntax - order: 5 - public: true customTitle: type: Boolean default: true title: Support custom titles hint: Allow custom titles like > [!NOTE] Custom Title - order: 6 + order: 1 public: true diff --git a/server/modules/rendering/markdown-github-alerts/renderer.js b/server/modules/rendering/markdown-github-alerts/renderer.js index e457f817..5bf2d639 100644 --- a/server/modules/rendering/markdown-github-alerts/renderer.js +++ b/server/modules/rendering/markdown-github-alerts/renderer.js @@ -11,12 +11,12 @@ module.exports = { function githubAlertsPlugin(md, options = {}) { const alertTypes = { - 'note': { enabled: options.enableNoteAlert !== false, class: 'is-info' }, - 'info': { enabled: options.enableNoteAlert !== false, class: 'is-info' }, - 'tip': { enabled: options.enableTipAlert !== false, class: 'is-success' }, - 'warning': { enabled: options.enableWarningAlert !== false, class: 'is-warning' }, - 'important': { enabled: options.enableImportantAlert !== false, class: 'is-info' }, - 'caution': { enabled: options.enableCautionAlert !== false, class: 'is-danger' } + 'note': { class: 'is-info' }, + 'info': { class: 'is-info' }, + 'tip': { class: 'is-success' }, + 'warning': { class: 'is-warning' }, + 'important': { class: 'is-info' }, + 'caution': { class: 'is-danger' } } // Add custom rule to transform GitHub alert syntax @@ -36,9 +36,9 @@ function githubAlertsPlugin(md, options = {}) { const alertType = alertMatch[1].toLowerCase() const customTitle = alertMatch[2] ? alertMatch[2].trim() : null - // Check if this alert type is enabled + // Check if this is a valid alert type const alertConfig = alertTypes[alertType] - if (alertConfig && alertConfig.enabled) { + if (alertConfig) { // Collect all blockquote lines for this alert let blockquoteLines = [] let currentPos = pos + 1