Search code examples
targetmarkitup

how to add target="_blank" to markItUp plugin


What I am trying to do:

It appears that by default when you use the link option in markitup to add a link, then clicking on the link opens it in the same page.

What I have tried:

I looked at the sets.js file and found the following line:

{name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' }

I tried adding target:'_blank' (see below) which didn't work:

{name:'Link',target:'_blank', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' }

Can someone please help out in getting this to work.


Solution

  • Found what i was doing wrong. The following works:

    {name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!) target="_blank">', closeWith:'</a>', placeHolder:'Your text to link...' },