netnr / LinkAsMd.js
2019-09-09 07:18
页面链接转成Markdown
  LinkAsMd.js javascript
var links = document.links, i = 0, md = [];
for (var len = links.length; i < len; i++) {
    var link = links[i];
    md.push("[" + link.innerHTML.replace(/\[/g,'\\[').replace(/\]/g,'\\]') + "](" + link.href + ")");
}
console.log(md.join('  \n'))
ˆ