Convert to Blocks: HTML Attributes are not copied to the DOM Node within callbacks of custom transforms #8648
Labels
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Bug
An existing feature does not function as intended
Dear Gutenberg Team,
the "Convert to Blocks" feature (content parser) seems to ignore element attributes on raw DOM Nodes.
By converting "RAW" blocks by custom transform rules, no attributes are available within the
isMatch(node)
callback even if they are defined in the legacy html sources.Example Code to reproduce the issue
Plugin
Editor Content
Current Behaviour
Attributes are ignored by the parser and not copied to the
node
passed to the transform callbacksisMatch(node)
/transform(
node`)Console Output
![gutenberg_transform_attribute_bug](https://user-images.githubusercontent.com/1474107/43762214-9faf6770-9a27-11e8-9dc8-cc760a455c48.png)
Expected Behaviour
ALL attributes should be copied to the node (and become available in
isMatch(node)
+transform(node)
to apply custom transform rules.This is absolutely required to convert legacy addons to blocks (lot of them are based on custom classes)
best regards, Andi
The text was updated successfully, but these errors were encountered: