Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate moveElemsAttrsToGroup, cleanupEnableBackground. #45

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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