1

I have a strange issue involving a template in a PageBuilder widget.

If I use the following code:

<script id="device-search-result" type="text/x-magento-template">
    <div class="flex-container">
        <div class="device-search-result-container">Test</div>
    </div>
</script>

The output is:

<script id="device-search-result" type="text/x-magento-template">
    <div class="flex-container">
        <div class="device-search-result-container">Test</script>

</div>
    </div>

This occurs before even calling mageTemplate() on it.

I can nest multiple div's, but where the first closing tag occurs, it puts the tag in between. This results in the HTML after this tag being visible.

I triple checked the validity of the HTML above this piece of code. The source as well as the generated source in the console. The strange thing is that it also goes wrong in the non-generated source.

Any thoughts on this?

It happens in Chrome, as well as Firefox (which shouldn't be relevant, because it is about the non-generated source).

  • Another detail: If I change <script id="device-search-result" type="text/x-magento-template"></script> to <div id="device-search-result" type="text/x-magento-template"></div>, the content of it stays intact. I've counted the <script> tags in the source numerous times, but they are all matching up. – Sander Aug 26 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.