Skip to content

Commit

Permalink
Deprecate moveElemsAttrsToGroup, cleanupEnableBackground. (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkenny54 authored Oct 10, 2024
1 parent ed6b698 commit ed5034f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/cleanupEnableBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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, {
Expand Down
8 changes: 8 additions & 0 deletions plugins/moveElemsAttrsToGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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() ||
Expand Down

0 comments on commit ed5034f

Please sign in to comment.