1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-29 18:19:44 +02:00

Update CodeMirror dep to v5.42.2

Affects Code and Markdown section types
This commit is contained in:
Harvey Kandola 2019-01-08 14:48:23 +00:00
parent c706edec47
commit 479a61a3ef
347 changed files with 21845 additions and 20770 deletions

View file

@ -12,7 +12,7 @@
.CodeMirror { border: 2px inset #dee; }
</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
@ -71,6 +71,17 @@ class TipCalculatorModel {
}
func funWithStrings() {
var numLines = 3
print("This is a string!")
print("""
This is a
multi-line
string!
""")
print("The preceding string had \(numLines) lines!")
}
}
</textarea></form>

View file

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// Swift mode created by Michael Kaminsky https://github.com/mkaminsky11
@ -73,9 +73,8 @@
stream.match("..")
return "punctuation"
}
if (ch == '"' || ch == "'") {
stream.next()
var tokenize = tokenString(ch)
if (ch = stream.match(/("{3}|"|')/)) {
var tokenize = tokenString(ch[0])
state.tokenize.push(tokenize)
return tokenize(stream, state)
}
@ -117,6 +116,7 @@
}
function tokenString(quote) {
var singleLine = quote.length == 1
return function(stream, state) {
var ch, escaped = false
while (ch = stream.next()) {
@ -126,13 +126,16 @@
return "string"
}
escaped = false
} else if (ch == quote) {
break
} else if (stream.match(quote)) {
state.tokenize.pop()
return "string"
} else {
escaped = ch == "\\"
}
}
state.tokenize.pop()
if (singleLine) {
state.tokenize.pop()
}
return "string"
}
}

View file

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "swift");
@ -35,7 +35,12 @@
// Strings and string interpolation.
MT("strings",
"[keyword var] [def a][punctuation :] [variable-2 String] [operator =] [string \"test\"]",
"[keyword var] [def b][punctuation :] [variable-2 String] [operator =] [string \"\\(][variable a][string )\"]");
"[keyword var] [def b][punctuation :] [variable-2 String] [operator =] [string \"\\(][variable a][string )\"]",
"[keyword var] [def c] [operator =] [string \"\"\"]",
"[string multi]",
"[string line]",
"[string \"test\"]",
"[string \"\"\"]");
// Comments.
MT("comments",