Description
Description
When inserting HTML code with URL query parameters into HTML blocks in the Unlayer email editor, ampersand (&
) characters in URLs are incorrectly converted to "not equal" (¬
) symbols followed by the next character. This breaks URL functionality in the generated email templates.
Reproduction Steps
- Create a new email template in Unlayer
- Add an HTML block component to the template
- Edit the HTML block and insert HTML that contains a URL with query parameters
- Save the HTML block
- Check the rendered HTML or the exported HTML
Example Code
Original HTML input:
<td valign="middle" class="lg_pic">
<a href="{{link}}¬e=5" style="border-width:0;" target="_blank">
<img src="https://example.com/images/5-stars.png" alt="5 étoiles" title="5 étoiles" style="border:0;">
</a>
</td>
Resulting HTML output:
<td valign="middle" class="lg_pic">
<a href="{{link}}¬e=5" style="border-width:0;" target="_blank">
<img src="https://example.com/images/5-stars.png" alt="5 étoiles" title="5 étoiles" style="border:0;">
</a>
</td>
Expected Behavior
The ampersand character should be preserved as-is or properly encoded as &
in the HTML output, but should not be converted to a different character that breaks URL functionality.
Environment
- Unlayer version: "vue-email-editor": "latest",
- Framework version: Vue.js ["^3.1.0"]
Additional Context
This issue specifically affects template variables in URLs. When using URL query parameters with the ampersand character after a merge tag/template variable (like {{link}}¬e=5
), the ampersand is combined with the next character to form the "not equal" character, breaking the URL structure.
We've attempted various workarounds including:
- Pre-encoding the ampersand as
&
- still results in character conversion - Using URL-encoded characters - inconsistent results
- Creating merged template variables - requires significant template changes
Impact
This bug prevents us from using query parameters in URLs that contain template variables, which breaks critical functionality in our email campaigns where we need to pass parameters for tracking and routing purposes.
Possible Solution
A fix could involve either:
- Preserving special characters in HTML blocks without conversion
- Properly encoding ampersands as HTML entities without combining them with following characters
- Adding a configuration option to disable special character processing in HTML blocks
Thank you for looking into this issue. Please let me know if you need any additional information or clarification.