- This topic has 5 replies, 3 voices, and was last updated 3 months, 3 weeks ago by Alexander.
September 25, 2020 at 3:35 am #1458229Alexander
I am using Generatepress 3.0 beta2 and the latest GP Premium RC with Generateblocks on a site that I am currently working on.
Previously I was using an SVG sprite sheet for a handful of icons that are being used throughout the site like so:
<svg class="mysvgicon"> <use xlink:href="/wp-content/themes/mytheme/svg/si-sprite.svg#si-entypo-brush"></use></svg>
Now I am trying to do the same with the icon option in Generateblocks but my code seems to fall victim to sanitization.
What would be a good way of getting this to work?
Also, do you recommend using the Generateblocks Headline block for paragraphs over the default WordPress paragraphs?
Thanks in advance!September 25, 2020 at 5:25 am #1458339DavidStaffCustomer Support
The GB Icon field will only accept an inline SVG – you cannot use xlink:href at this time. That maybe something we review in the future but that method doesn’t have the best browser support….
Paragraphs – no we recommend you use a Paragraph block. Reserve using the Headline Block when you need to create a different styled element to those the Customizer body/heading typography provides.September 25, 2020 at 5:36 am #1458356Alexander
that is too bad. It would be great if this could be supported in a future version.
I noticed that xlink is being depreciated and the recommended way of linking is now plain href.
Browser support seems OK with the exception of IE naturally but can be worked around with something like https://github.com/jonathantneal/svg4everybody
I believe that a saw a post by Tom in the past with some code that lets you bypass the sanitization (could not find it again via search now). Since I am the only person that will be working on/having publishing rights on the site, do you think this would be a feasible option?September 25, 2020 at 7:52 am #1458655DavidStaffCustomer Support
Theres this article which covers the WP sanitization:
Not aware of anything that excludes DomPurify from the code.
Ill pass this on to Tom.September 25, 2020 at 9:35 am #1458825TomLead DeveloperLead Developer
There is no way around DOMPurify at this time. Not sure if we’ll work that in, but it’s worth looking to see if we can allow this sort of implementation safely.September 26, 2020 at 12:54 am #1459513Alexander
That would be great. I do think that having a cache-able spritesheet does have benefits and support for it seems quite good with some exceptions.
- You must be logged in to reply to this topic.