MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / html

Function html

mini-code-edit/cm/mode/htmlmixed/htmlmixed.js:6–21  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

4 var cssMode = CodeMirror.getMode(config, "css");
5
6 function html(stream, state) {
7 var style = htmlMode.token(stream, state.htmlState);
8 if (style == "tag" && stream.current() == ">" && state.htmlState.context) {
9 if (/^script$/i.test(state.htmlState.context.tagName)) {
10 state.token = javascript;
11 state.localState = jsMode.startState(htmlMode.indent(state.htmlState, ""));
12 state.mode = "javascript";
13 }
14 else if (/^style$/i.test(state.htmlState.context.tagName)) {
15 state.token = css;
16 state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
17 state.mode = "css";
18 }
19 }
20 return style;
21 }
22 function maybeBackup(stream, pat, style) {
23 var cur = stream.current();
24 var close = cur.search(pat);

Callers 2

javascriptFunction · 0.85
cssFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected