• I’m using a wonderful non js way to make parts of SVGs clickable putting them inline and wrapping paths with tags ie

    <svg>
      <a xlink:href="http://siteA.com">   <path A />  </a>
      <a xlink:href="http://siteB.com">   <path B />  </a>
      <path C />
    </svg>

    This works perfectly when I test it locally, on a wordpress site in a text widget, opening svg in browser but when I put it in a wordpress post as inline svg, everything after the path before the first a xlink shows, and it looks like everything after it disappears (http://www.mccannrealtors.com/847-2/) .

    In the source code it looks like wordpress renders it this way:

    <svg>
      <a xlink:href="http://siteA.com">   </a>
      </svg>
    </p>
      <path C />
      <path D />

    When I go back to edit the post, there are no changes injected by tinymce. The svg xml code looks as if it should, it’s only in the output that its injecting a closing svg tag and removing the contents of the a xlink tag.

    I’ve tested a bunch of snippets to remove other issues with svgs, ie. allow media upload, allow all tinymce element attributes. I removed all unnecessary spacing between svg elements because I saw that was a fix. It’s not a browser issue because I checked latest versions of Chrome, Firefox, and Safari for Mac.

    But I’m totally at a loss. It’s definitely an issue with the XML XLink and looks like wordpress isn’t respecting the svg

  • The topic ‘Bizarre: Inline SVG in posts breaks when using xml XLink’ is closed to new replies.