• Resolved kaleidografik

    (@dungey140)


    Hi there, when uplaoding SVGs, part of the ‘sanitation’ process adds <?xml version="1.0" encoding="UTF-8"?> to the SVG. This however unfortunately generates a HTML validation error as follows: Saw “<?”. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.).

    Is there anything that can be done to resolve this and create valid pages?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Support Darin Kotter

    (@dkotter)

    @dungey140 Curious where you’re seeing that error? Are you embedding an SVG inline or loading it within an img tag?

    The sanitizer class we use does have the option to strip out that XML tag:

    
    $sanitizer = new enshrined\svgSanitize\Sanitizer();
    $sanitizer->removeXMLTag( true );
    

    But unfortunately there isn’t a way to toggle that within the current codebase. You would probably need to hook into wp_handle_upload_prefilter after our class and then run the sanitization again with that option turned on.

Viewing 1 replies (of 1 total)

The topic ‘Uploaded SVGs generating validation XML error’ is closed to new replies.