Code Widget Formatting Shenanigans

Hi All, hoping someone might have a solution as I’ve seen this problem in version 2 and it remains in 3 and I haven’t seen a workaround yet.

Something in Blocs parsing of the HTML Widget/PHP Snippet warps the code.

This php becomes

while ($row = $q->fetch()):
_ echo “<option value=”" . htmlspecialchars($row[‘type’]) . “”>\n";_

this php

while ($row = $q->fetch()):
** echo “<option value=”&quot;"" .="" htmlspecialchars($row[‘type’])="" “”="">\n";**

I’ve had to manually modify code after export when it does this.
Am I missing something?

For anyone stumbling across this in future, managed to solve myself.

Turn off “Preview” for the HTML Widget (just below the Edit Code button) and Blocs will not parse the PHP code. The Preview function appears to change certain characters.

All fixed :slight_smile:

1 Like