Skip to content

Updating children nodes of parent and passing them to be processed. #84

@simplecommerce

Description

@simplecommerce

Hi,

My question is quite peculiar and I believe is related to this issue.

To be as clear as possible, here is my situation.
In my HTML string I have a form with input fields.
I have a rule that checks for the form tag and then renders a react component for the form and passes its children.

I have another rule that processes the input nodes and renders react components.

I want to be able to determine if the input being processed is actually a child of the parent form tag.
In case the HTML string has input fields that are not under a form tag, etc. (for whatever reason)

So I was thinking that maybe I could process the node.children and set an attribute for each children matching the input field under the form node. I got the idea from here.

The problem is that when I do it like that, it doesn't process the other rules, for the same node.

So I was wondering, if there would be an easy way I could achieve this?

At first I was thinking of adding an attribute on the form tag, say form-identifier="something".
And then in the input node, go up the parent tree and look for that attribute.
Or do the reverse, and tag its children with an attribute, so I can recognize it when I get to the child in another rule.

Any help would be appreciated.

Great library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions