Enonic XP8 macros bug when field has quotes at the beginning and/or at the end

Enonic version: 8.0.4

OS: Debian

Enonic is not dropping the backslashes it uses to escape the quotes inside a macro input.

Do you mean inside rendering or inside the Macro dialog in Content Studio?

If you are talking about rendering then it’s the developer’s responsibility to correctly handle escaped values. For that you should use htmlUnescape method from text-encoding lib, as described in the docs:

Example:

import * as encoding from '/lib/text-encoding';

...

function createModel(req: MacroContext) {
   const quote = encoding.htmlUnescape(req.params.quote);
   ...
};

But in Content Studio we indeed have a bug which incorrectly handles escaped macro parameters. I have registered a bug here.

1 Like