• The problem
    When uploading an SVG with this plugin, the image appears broken in the Media Library. If the broken image is added to a post or page, it is not displayed. Following the image url in a browser displays an error saying “XML Parsing Error: undefined entity..”

    The cause
    After investigating further, I believe the problem is the way in which the plugin optimises SVG files. After downloading the SVGs after Safe SVG has done its work, I’ve noticed that the problem seems to be that the plugin removes the DOCTYPE tag from the SVG file.

    While DOCTYPE is an optional tag as far as the W3C QA standard, as far as browsers are concerned, it seems to be required.

    After adding the doctype back to the optimised SVG files manually and uploading them back to the webserver, the files act as they should. This is clear evidence that (for whatever reason) the doctype is required for the SVG file to render.

    This is true of all major browsers, latest versions.

  • The topic ‘XML Parsing Error: Undefined Entity’ is closed to new replies.