Shopify themes, liquid, logos, and UX
I'm editing the product description in the html code editor mode, so I'm marking up where I use non-breaking space between a number and a unit of measurement. For example,
10 bar
But today I noticed that Shopify just deletes non-breaking space after switching to preview mode and back to code editing. However, Shopify itself places the but not where I need them.
How does it work? Is this a Shopify error?
Hi @Anastasiia_D ! Most likely in your theme's code there is an escape string handler for this block, which removes all special characters. More details here: https://shopify.github.io/liquid/filters/escape/
I didn't even exited the product card editor. I just used the "code mode" button for the description, wroted the text and used "view mode" and then "code mode" again.
But thank you for your reply. This problem was temporary for me, but now everything is ok, I didn't notice it anymore.
you could consider using CSS properties like white-space: nowrap; or adjusting the layout and styling to accommodate the desired spacing. Shopify's code editor has a feature that automatically removes non-breaking spaces ( ) when switching between preview mode and code editing mode. This behavior is intentional and not an error.
Thank you. Yes, I already use this method, it works well.
Not an error, Shopify with Liquid will escape characters (no left and right special chars). It's a normal behaviour.
Hi ✌️
Just use a JSON filter and then replace the string with the correct view. Example:
{%- liquid
echo "<span>10 bar<span>" | json | replace: '\u0026nbsp;', ' ' | replace: '\u003c', '<' | replace: '\u003e', '>'
-%}
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024