Skip to content

Instantly share code, notes, and snippets.

@mihailik mihailik/index.html
Created Nov 23, 2015

Embed
What would you like to do?
<!doctype html>
<title>CodeMirror</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="https://codemirror.net/lib/codemirror.css">
<script src="https://raw.githack.com/mihailik/CodeMirror/patch-7/lib/codemirror.js"></script>
<script src="https://codemirror.net/mode/xml/xml.js"></script>
<script src="https://codemirror.net/mode/javascript/javascript.js"></script>
<script src="https://codemirror.net/mode/css/css.js"></script>
<script src="https://codemirror.net/mode/htmlmixed/htmlmixed.js"></script>
<script src="https://codemirror.net/addon/edit/matchbrackets.js"></script>
<style>
.CodeMirror {
height: 100%;
}
</style>
<div id=host style="border: solid 2px red; height: 90%;">
</div>
<script id=scr>
var editor;
window.onload = function() {
editor = CodeMirror(host, {
lineNumbers: true,
updateWhenComposing: true
});
editor.getDoc().setValue(document.documentElement.outerHTML);
editor.focus();
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.