Editor previews resolve variables while retaining markers
The editor shows the variable's value to the person editing and puts the variable back on save, including in images and links.
A page uses variables such as the site's root address. In the editor they showed up raw: the variable's text in place of the value, and broken images because the address was not an address.
In July: text and widgets
The server started handing the editor the global variables already resolved, each in a box that keeps the original text. On save, the box becomes the variable again. The database receives the variable, not the value: changing the site's address later still works.
The preview uses the same path. Local variables, which depend on the page's context, stay as they are.
In September: attributes and layouts
The same problem existed in attributes: a src or href with a variable reached the browser as raw text and triggered a request to an address that did not exist. The fix stores, for each resolved attribute, the original and the value.
- If the attribute was not touched, the variable comes back on save.
- If someone changed the address by hand, the change wins.
The layout editor got the same treatment, and extracting the HTML no longer reloads images and videos at every step.
Source: Core · req-093 and req-162 · BATCH-093/164