I've been working with Microsoft Portals (now rebranded as Power Pages) for over a year. During this time, one issue continues to emerge that will break my web pages. At random times, something on the back end will try to reformat my liquid scripts and sometimes my JavaScript.
For example, I will add a liquid script if tag in the middle of my JavaScript (perfectly acceptable) and it will work. A couple hours later, I'll view the page in the Power Pages editor, click sync, and view the page in my browser to see the page doesn't load properly and there are errors reported in the console. When I check back, I see that my liquid script was completely reformatted like what is seen below.
Example of what it looked like originally
<script>
...
{% if liquidVariable = "someValue" %}
...
{% endif %}
</script>
Example of how it gets auto formatted
<script>
...
{
%
if liquidVariable = "someValue"
%
}
...
{
%
endif
%
}
</script>
In addition, it appears the web pages do not like self closing tags on HTML elements as the "auto-formatter" (or whatever is causing these issues) will try to replace the self closing tag with a manual tag (though it always puts it in the incorrect spot).
Example:
<img />
will be automatically changed to
<img></img>
If anyone knows the cause of these "auto-formats" and how to disable it, I would greatly appreciate any additional information.