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', '>'
-%}
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024