Skip to content

Multiple mixed content being ignored #36

Description

@Nokel81

The following is modified example from the readme:

var example5 = [{
    toys: [{
            _attr: {
                decade: '80s',
                locale: 'US'
            }
        },
        {
            toy: [{
                    _attr: {
                        decade: '80s',
                        locale: 'US'
                    }
                },
                'Transformers',
                {
                    toya: [{
                        _attr: {
                            knowing: 'half the battle'
                        }
                    }, 'GI Joe']
                }
            ]
        }
    ]
}];

And it produces

<toys decade="80s" locale="US">
    <toy decade="80s" locale="US">
        Transformers
        <toya knowing="half the battle">GI Joe</toya>
    </toy>
</toys>

However, if another piece of mixed data is added like this:

var example5 = [{
    toys: [{
            _attr: {
                decade: '80s',
                locale: 'US'
            }
        },
        {
            toy: [{
                    _attr: {
                        decade: '80s',
                        locale: 'US'
                    }
                },
                'Transformers',
                {
                    toya: [{
                        _attr: {
                            knowing: 'half the battle'
                        }
                    }, 'GI Joe']
                },
                ' and the A-team'
            ]
        }
    ]
}];

The sub object is just ignored and the following is outputted:

<toys decade="80s" locale="US">
    <toy decade="80s" locale="US">Transformers and the A-team</toy>
</toys>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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