Hi,
I have been trying to figure out how to fix the inline svg issue I am having. When I add my input in the body field in ckeditor it looks like below.
<a class="text-success mt-auto" href="#">Learn More <svg class="angle-right" viewbox="0 0 256 512" xmlns="http://www.w3.org/2000/svg"><path d="M187.8 264.5L41 412.5c-4.7 4.7-12.3 4.7-17 0L4.2 392.7c-4.7-4.7-4.7-12.3 0-17L122.7 256 4.2 136.3c-4.7-4.7-4.7-12.3 0-17L24 99.5c4.7-4.7 12.3-4.7 17 0l146.8 148c4.7 4.7 4.7 12.3 0 17z"></path></svg></a>
When the page is rendered the svg tags automatically close and a break tag is added.
<a class="text-success mt-auto" href="#">Learn More <svg class="angle-right" viewBox="0 0 256 512" xmlns="http://www.w3.org/2000/svg"></svg><br><path d="M187.8 264.5L41 412.5c-4.7 4.7-12.3 4.7-17 0L4.2 392.7c-4.7-4.7-4.7-12.3 0-17L122.7 256 4.2 136.3c-4.7-4.7-4.7-12.3 0-17L24 99.5c4.7-4.7 12.3-4.7 17 0l146.8 148c4.7 4.7 4.7 12.3 0 17z"></path></a>
Thank you in advance.
Comments
Comment #2
celestglow@gmail.com commentedComment #3
WebbehDoes this issue occur when CKEditor is disabled and you insert the SVG markup into a raw (no filter) long text field? That should narrow where this issue belongs (likely your CKEditor WYSIWYG configuration of choice in Drupal 7), as this does not belong as the image system in Drupal core.
Comment #4
celestglow@gmail.com commented@webbeh Does this issue occur when CKEditor is disabled and you insert the SVG markup into a raw (no filter) long text field? Yes. I went to disable to test.
Comment #5
WebbehCan you recreate on a website that has only the core functionality enabled, to test to see if an additional, contrib module is causing this?
Comment #6
avpadernoComment #7
avpadernoThis seems related to #2925487: svg element is rendered broken in Full HTML format.
Comment #9
poker10 commentedI think this is a duplicate of the mentioned issue. Hopefully it will get fixed soon.