Closed (fixed)
Project:
Migrate Plus
Version:
8.x-5.x-dev
Component:
Plugins
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
27 Jul 2021 at 09:15 UTC
Updated:
29 Apr 2022 at 13:49 UTC
Jump to comment: Most recent
Currently dom_remove just removes tags specified by the xpath selector.
Add the ability to configure the plugin to remove an attribute on tags specified by the xpath selector.
The default functionality of the plugin remains the same so that no changes need to be made to existing migrations and it continues to work as before.
For example,
process:
bar:
-
plugin: dom
method: import
source: text_field
-
plugin: dom_remove
mode: attribute
selector: //*[@style]
attribute: style
-
plugin: dom
method: exportwill remove all style attributes from all tags in the process pipeline.
This is replicated from drupal spoons: https://gitlab.com/drupalspoons/migrate_plus/-/merge_requests/9
| Comment | File | Size | Author |
|---|---|---|---|
| add-remove-attribute-mode-to-dom-remove.patch | 5.96 KB | richardgaunt |
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
richardgaunt commentedComment #3
richardgaunt commentedComment #4
star-szrNot sure how this issue queue works exactly but setting to needs review and left some nitpicks on the merge request: https://gitlab.com/drupalspoons/migrate_plus/-/merge_requests/25
Otherwise, this looks good and works well. Thank you for sharing this!
Comment #9
matroskeenI applied some minor changes to documentation, and tests, and reverted the
$walking_dead, I just like it! :)It was merged into
8.x-5.xand cherry-picked into6.0.x.Thank you!