Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author assortedchips

    (@assortedchips)

    Normally SVG images can have links in them. However, WordPress prevents this from happening for security reasons. There is a workaround for this, which will likely be in the next version of the DrawIt plugin. You can read the discussion on this here.

    Otherwise, you can use HTML area tags to manually put links on any image: https://www.w3schools.com/tags/tag_area.asp.

    hello, Julian, i’ve tried to use your module, thats great, thanks for your work!

    but, i encountering the same problem:
    – yes, i’ve read conversation on g+, you mentioned,
    – yes, i use svg (not png),
    – browser – firefox,
    – plugin settings: https://pix.my/lVUszlQf

    Plugin Author assortedchips

    (@assortedchips)

    No support has been added for this yet. I have received feedback from Julian on how he got a custom version implemented, but I simply have not had time to integrate it into DrawIt. I will leave this topic open as a reference that this still needs to be done. Thanks for bringing back up.

    I know it’s a bit late, but I had the same problem, so I wrote a minor fix, that replaces the img with the svg … hope this helps;)
    It’s important, that when you create your diagram, it has to be exportet as an svg.

    jQuery(document).ready(function($) {
        $('img[title="drawit diagram"]').each(function(index){
    		var diagram = $(this);
    
    		var diagramImg = diagram.attr('title', 'drawit diagram');
    		var diagramImgSrc = diagramImg.context.src;
    				
    		var diagramClasses = diagramImg.context.className;
    		var diagramWidth = diagramImg.context.clientWidth;
    		
    		var container = $('<div class="drawio-diagram ' + diagramClasses + '" style="width:' + diagramWidth + 'px"></div>');
    		container.insertAfter(diagram);
    		
    		container.load(diagramImgSrc);
    		diagram.remove();
    	});
    });
    Plugin Author assortedchips

    (@assortedchips)

    I have added some basic support for SVG images with links in them. I have not released it as an official version yet, but you can download the dev version to test it out by downloading and installing the “Development version” of the plugin from https://www.ads-software.com/plugins/drawit/developers/

    Allowing links in SVGs has security implications if you end up getting SVGs from untrusted sources. To enable having links in SVGs, go to the DrawIt settings page in your WordPress installation and enable the “Use insecure version for SVG images” option.

    Please let me know if you find any bugs or run into any problems so I can fix them before releasing to everyone.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to insert a link?’ is closed to new replies.