Skip to content

Instantly share code, notes, and snippets.

@rednebmas
Created February 12, 2016 20:51
Show Gist options
  • Select an option

  • Save rednebmas/6ce6571931ce230ba4cd to your computer and use it in GitHub Desktop.

Select an option

Save rednebmas/6ce6571931ce230ba4cd to your computer and use it in GitHub Desktop.
Print document HTML in an Anki Card
<script>
var pretag = document.createElement("pre");
pretag.innerHTML = document.getElementsByTagName("html")[0].outerHTML.replace(/[\u00A0-\u9999<>\&]/gim, function(i) {
return '&#'+i.charCodeAt(0)+';';
});
document.body.appendChild(pretag);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment