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

celestglow@gmail.com created an issue. See original summary.

celestglow@gmail.com’s picture

Issue summary: View changes
Webbeh’s picture

Component: image system » filter.module
Priority: Normal » Minor

Does 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.

celestglow@gmail.com’s picture

@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.

Webbeh’s picture

Can you recreate on a website that has only the core functionality enabled, to test to see if an additional, contrib module is causing this?

avpaderno’s picture

Issue tags: -ck editor, -svg, -inline svg, -close tags
avpaderno’s picture

Version: 7.67 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

poker10’s picture

Status: Active » Closed (duplicate)
Related issues: +#2925487: svg element is rendered broken in Full HTML format

I think this is a duplicate of the mentioned issue. Hopefully it will get fixed soon.