njleonzhang / docsify-edit-on-github

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't open link on another tab

mateuswetah opened this issue · comments

Hi guys, thanks again for the plugin!

I'm noticing a strange behavior, not sure if directly related to the plugin:

  • Open the link directly: Works Fine :) ;
  • Open the link by right clicking on browser to open another tab: 404 error on github :(

Test it here: https://tainacan.github.io/tainacan-wiki/#/pt-br/getting-started

Any ideas?

the navigate behavior is implemented by click event. So only click can trigger the correct jump currently.

'<p style="float: right"><a href="',
docBase,
'" target="_blank" onclick="EditOnGithubPlugin.onClick(event)">',
title,

I see... wouldn't it be possible to do something like:

'<a :href="getDocBase() " target="_blank">',

Then

function getDocBase(event, vm) {
      var docName = vm.route.file

      if (docName)
         return docEditBase + docName;
      else
         return docBase;
}

?

Yeah, I think it can be implemented as you wished. I Will consider to implement later. If you need this feature currently, you can implement it and submit a PR. 😄

prevent the right click in commit 470917a