<!doctype html
>
<title>CodeMirror
: Theme Demo
</title
>
<meta charset
="utf-8"/>
<link rel
="stylesheet" href
="https://cdn.staticfile.org/codemirror/5.58.1/codemirror.css">
<link rel
="stylesheet" href
="https://cdn.staticfile.org/codemirror/5.58.1/theme/dracula.css">
<script src
="https://cdn.staticfile.org/codemirror/5.58.1/codemirror.js"></script
>
<script src
="https://cdn.staticfile.org/codemirror/5.58.1/mode/javascript/javascript.js"></script
>
<style>
.CodeMirror
{border
: 1px solid black
; font
-size
:13px
; width
:500px
; height
:200px
}
</style
>
<article>
<h2>Theme Demo
</h2
>
<form>
<textarea id
="code" name
="code">
function
findSequence(goal
) {
function
find(start
, history
) {
if (start
== goal
)
return history
;
else if (start
> goal
)
return null
;
else
return find(start
+ 5, "(" + history
+ " + 5)") ||
find(start
* 3, "(" + history
+ " * 3)");
}
return find(1, "1");
}
</textarea
>
</form
>
<script>
var editor
= CodeMirror
.fromTextArea(document
.getElementById("code"), {
lineNumbers
: true,
styleActiveLine
: true,
matchBrackets
: true,
readOnly
: true,
theme
:"dracula",
viewportMargin
: Infinity
});
</script
>
</article
>
转载请注明原文地址: https://lol.8miu.com/read-36297.html