EJS Syntax in `dmx-param` Gets Escaped After Saving Server Connect

Wappler Version: 7.0.0 Beta 33
Operating System: Windows 11
Server Model: NodeJS
Hosting Type: Localhost


Expected behavior

The dmx-param:report_rule value should retain valid EJS syntax when saving the dmx-serverconnect component.

In the code editor, the EJS value is entered correctly as:

dmx-param:report_rule="'<%= (access.access_item,'locals') %>'"

This is the expected syntax and should not be altered automatically.


Actual behavior

After saving the dmx-serverconnect in Wappler, the EJS code gets auto-converted into HTML entities:

dmx-param:report_rule="'&lt;%= (access.access_item,'locals') %&gt;'"

This breaks the EJS syntax and causes issues at runtime.


How to reproduce

  1. Open a page in Wappler.
  2. Add or edit a <dmx-serverconnect> component.
  3. Set a parameter using valid EJS syntax like:
    dmx-param:report_rule="'<%= (access.access_item,'locals') %>'"
  4. Save the file.
  5. The EJS expression will be converted to escaped HTML entities (&lt;, &gt;), corrupting the syntax.

Screenshots

Before Saving:

After Saving:


This seems to be a bug related to how Wappler handles special characters in attribute values — it should preserve the raw content for templating syntax like EJS.

Please let me know if you need a clean test file to replicate.

1 Like

This has been so since first version I think.
In some cases, the editor does handle the EJS expression correctly, and does not change it.
But in most cases, it does not.

1 Like

This happened, a lot! to me, I'd have a group of rendered values that would need to be reinserted for dmx-onclick action again, and again :man_facepalming:
However, I did notice, that values don't change,as long as component's aren't altered, e.g. if you have onclick event and open app connect value binding window,or binding additional values via monaco editor. I could swear the ssr values were affected less if wappler didn't have to touch them again!

Actually, I haven't tried whitespace slurping tag inside the attribute binding, but If i remember correctly, design view simply doesn't even recognise them, as I used them for dynamic javascripts,etc. <%-_('script',locals)%>, maybe worth a try and quotations won't affect them? :thinking:

1 Like

For future reference, can confirm, binding SSR values with whitespace slurping tag <%-_('user.email',locals)%> inside of the quotations dmx-bs-tooltip="'<%-_('user.email',locals)%>', prevents wappler converting < and > to less than, or greater than conditional operators. However, are no longer visually dynamically bindable(via server side/app connect popup manager/window).

when it will get fixed ?

I haven’t seen any updates to ssr or anything related to it, since ive started using it. Given the nature of the issue, unfortunately I wouldn’t wait for the fix just now, and proceed to apply the ssr normal way, and refrain from editing elements in properly panel, as this is what seems to be causing this behaviour. No matter the structure of the syntax. It would be great if we were able to enclose them is special characters that would prevent such behaviour though! :man_shrugging:

1 Like

still not fixed in this update @George

No it is not fixed, if it was it would be mentioned.

Also the field there with the picked is currently meant for client side data.

When we add support for server data side pickers, it will be enhanced to support it.

For you can just enter the right expression in code view just as easy when you are enter it manually anyway.

1 Like