Short description of issue
Theme editor customizer bug with auto wrapped HTML-comments for richtext field types
Link to Shopify Store
Reproduction steps
The section has two settings (field type “richtext”) for displaying content. One setting is for displaying text on the desktop, the other is for displaying text for mobile resolutions. In the code, they are declared as follows: Monosnap. The variable “text_content_mobile” is assigned the default value of the variable “text_content_desktop” in case the mobile text is not specified.
If the “text_content_mobile” setting is empty, the text from the ‘text_content_desktop’ setting is displayed on mobile devices by default, which we specify through the “default” filter Monosnap
If add any text to the text_content_mobile, both the content from the ‘text_content_desktop’ and the content from the “text_content_mobile” will be displayed, and with extra HTML comment characters Monosnap .
If remove the “default” filter and assign the value fallback value to the text_content_mobile variable using the IF condition, the bug disappears - screen-4
Additional info
The error is that the theme editor wraps content that is output from “richtext” settings in HTML comments, and some kind of bug occurs, which breaks the HTML markup of the section and outputs extra characters. Also, instead of outputting the content of the “text_content_mobile” setting variable the content of the “text_content_desktop” setting variable is also displayed, which is specified through the “ | default” filter.
This code has always been in the theme and everything worked fine before.
Video with a bug: Monosnap
I have also attached screenshots, which are provided as links in the text.
What type of topic is this
Bug report



