From ba0cce13b2964f3d7738938dd2565d705645fd5d Mon Sep 17 00:00:00 2001 From: John Kenny Date: Thu, 10 Oct 2024 06:49:10 -0700 Subject: [PATCH] Deprecate moveElemsAttrsToGroup, cleanupEnableBackground. --- plugins/cleanupEnableBackground.js | 8 ++++++++ plugins/moveElemsAttrsToGroup.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/plugins/cleanupEnableBackground.js b/plugins/cleanupEnableBackground.js index d860bba..3dd2c8f 100644 --- a/plugins/cleanupEnableBackground.js +++ b/plugins/cleanupEnableBackground.js @@ -8,6 +8,8 @@ export const description = const regEnableBackground = /^new\s0\s0\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)$/; +let deprecationWarning = true; + /** * Remove or cleanup enable-background attr which coincides with a width/height box. * @@ -20,6 +22,12 @@ const regEnableBackground = * @type {import('./plugins-types.js').Plugin<'cleanupEnableBackground'>} */ export const fn = (root) => { + if (deprecationWarning) { + console.warn( + 'The cleanupEnableBackground plugin is deprecated and will be removed in a future release.', + ); + deprecationWarning = false; + } let hasFilter = false; visit(root, { diff --git a/plugins/moveElemsAttrsToGroup.js b/plugins/moveElemsAttrsToGroup.js index a496cf6..eca0932 100644 --- a/plugins/moveElemsAttrsToGroup.js +++ b/plugins/moveElemsAttrsToGroup.js @@ -4,6 +4,8 @@ export const name = 'moveElemsAttrsToGroup'; export const description = 'Move common attributes of group children to the group'; +let deprecationWarning = true; + /** * Move common attributes of group children to the group * @@ -27,6 +29,12 @@ export const description = * @type {import('./plugins-types.js').Plugin<'moveElemsAttrsToGroup'>} */ export const fn = (root, params, info) => { + if (deprecationWarning) { + console.warn( + 'The moveElemsAttrsToGroup plugin is deprecated and will be removed in a future release.', + ); + deprecationWarning = false; + } const styleData = info.docData.getStyles(); if ( info.docData.hasScripts() ||