Fusion Augmenter - attributes with a dot inside key

Hello everyone,
I’m trying to add an html attribute that contains a dot inside the key to an html attribute using the Fusion Augmenter.

Neos.Fusion:Augmenter {
    some.key='value'
}

expected result:

<div some.key="value">

actual result:

<div></div>

Is there any way to escape the dot so it does not get interpreted as a nested fustion key?

i would expect this to work

Neos.Fusion:Augmenter {
    'some.key'='value'
}

Thanks for you swift reply.
Sadly not it does not work.

'"some.key"'='value'

Doesn’t do the trick either

Unfortunately this seems not to be possible out of the box because the “.” is parsed as a property path by Fusion and AFAIK there is no way to escape it.
For now you could do a little hack:

root = 'Just a test'
root.@process.augment = Neos.Fusion:Augmenter {
    'some###DOT###key' = 'value'
    @process.replaceDot = ${String.replace(value, '###DOT###', '.')}
}

See https://fusionpen.punkt.de/fusionpen/7a94b1b2f19aaa1d203a0fc48656d19fc6efc1be.html

BTW: Are dots in attributes allowed in the HTML spec?

Thank you very much! :slight_smile:

According to this it is allowed: https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 but I don’t think it is commonly used.
The javascript library AlpineJs uses it for its modifiers.

1 Like