Created
October 19, 2014 10:04
-
-
Save neftaly/e8fde6c456f178f3b787 to your computer and use it in GitHub Desktop.
Delete \t's in <pre> elements, so that HTML can be indented nicely. Use " " for intentional indents.
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script language="Javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script language="Javascript" src="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.js"></script> | |
<script language="Javascript"> | |
$(document).ready(function() { | |
// Delete \t's in <pre> elements, so that HTML can be indented nicely. Use " " for intentional indents. | |
$("pre.prettyprint").text(function(index, text) { | |
return text.replace(/\t/g, ""); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<pre class="prettyprint lang-js"> | |
// This is an example | |
if (true) { | |
if (false) { | |
// Nested code | |
} | |
} | |
</pre> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment