You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#102035 Using svg tag in editor

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Tuesday, 16 March 2021 11:46 GMT

alteabz
Hello,
I need to insert a svg directly in the code of the article (because I need to style it later with css) but everytime I switch to editor view the svg tag get's deleted.

I did try to search for a place to enable the use of the svg tag but I wasn't able to find it.
Can anyone help me out?

Ryan
Please install this plugin - https://github.com/widgetfactory/jce-editor-svg

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

alteabz
Thanks Ryan for the quick answer, I did install the plugin but I cannot see it in the "Additional Features" of the profiles.
Could it be because I'm using JCE PRO?



In the plugin page I can find the plugin and it is enabled.

Attachments

Ryan
Please download and install the latest released - https://github.com/widgetfactory/jce-editor-svg/releases/tag/1.0.1

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

alteabz
Perfect!!
Thank you

woluweb
Hi Ryan! I came across this post and yeahhh now I can copy-paste SVG in my content :) I still have a last issue : for some of the SVG (like the first one on https://codepen.io/woluweb/pen/MWjroKX) JCE keeps stripping rows like

<linearGradient x1="0%" y1="100%" y2="0%" id="creditcard-c">
which breaks the svg of course. What is then the solution or workaround ? Txs!

Ryan
Please try this updated version - https://github.com/widgetfactory/jce-editor-svg/releases/tag/1.0.2

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

woluweb
Yeah ! Txs Ryan: tested & approved 🙂
Works perfectly now.

Topper23
Hello Ryan,
as woluweb i found this thread. I sill have an issue with version 1.0.2...
In my case i use a svg-image file and also manipulate it with javascript (change classes of elements to make them (in-)visible). When switching from code view to JCE the svg-code is still (heavily?) manipulated and some classes are overwritten.

Original Code
https://www.unicaragil.de/images/svg-original.PNG

After JCE-Cleanup
https://www.unicaragil.de/images/svg-jceed.PNG

Is there a way to get rid of that cleanup?

Greetings Martin

Ryan
In Editor Profiles -> Editor Parameters -> Advanced, is Allow CSS set to Yes?

FYI - You don't need the SVG plugin if you set Allow Custom XML to Yes and set Enable Code Blocks to Yes. You won't see the svg image in the editor window, but you will be able to access the code directly.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.