Created
January 22, 2015 10:00
-
-
Save vojtech-dobes/8d8323af058adc31be3a to your computer and use it in GitHub Desktop.
Make <pre> readable
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
[].slice.call(document.querySelectorAll('pre'), 0).forEach(function (el) { | |
el.innerHTML = el.innerHTML.split("\n").join('<br>'); | |
}); | |
var style = document.createElement("style"); | |
style.appendChild(document.createTextNode("")); | |
document.head.appendChild(style); | |
style.sheet.insertRule("pre { white-space: normal }", 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment