Created
October 1, 2020 19:03
-
-
Save vmiheer/47d56ccaf73f4fdb26aeb2969d6bfbfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LoadLib(urls) { | |
var url; | |
for (url of urls) { | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = url | |
document.head.appendChild(script) | |
} | |
} | |
function loadScript2(scriptPath) { | |
const script = document.createElement("script") | |
script.type = "text/javascript" | |
script.src = scriptPath | |
document.head.appendChild(script) | |
eval(script) | |
} | |
loadScript2("https://unpkg.com/turndown/dist/turndown.js"); | |
loadScript2("https://unpkg.com/turndown-plugin-gfm/dist/turndown-plugin-gfm.js"); | |
//// | |
//// | |
//// | |
//// WAIT: PUT THE EALIER CONTENT BEFORE PUTTING NEXT CONTENT IN THE DEVELOPER CONSOLE | |
//// | |
//// | |
//// | |
const tmd = new TurndownService() | |
tmd.use(turndownPluginGfm.gfm) | |
tmd.addRule('justText', { | |
filter: ['th', 'td'], | |
replacement: function (content, node, options) { | |
return "|" + node.textContent + "|"; | |
}} | |
) | |
const md = tmd.turndown(document.querySelector("#win7divCRSE_HIST2\\$grid\\$0 > table")) | |
console.log(md) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment