mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge branch 'master' into chart-yaml
This commit is contained in:
44
extra_scripts/codemirror/mode/bfm/bfm.css
vendored
Normal file
44
extra_scripts/codemirror/mode/bfm/bfm.css
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
.cm-table-row-even { background-color: rgb(242, 242, 242); }
|
||||
.cm-s-3024-day.CodeMirror .cm-table-row-even { background-color: rgb(238, 237, 237); }
|
||||
.cm-s-3024-night.CodeMirror .cm-table-row-even { background-color: rgb(30, 24, 21); }
|
||||
.cm-s-abcdef.CodeMirror .cm-table-row-even { background-color: rgb(36, 39, 37); }
|
||||
.cm-s-ambiance.CodeMirror .cm-table-row-even { background-color: rgb(242, 242, 242); }
|
||||
.cm-s-base16-dark.CodeMirror .cm-table-row-even { background-color: rgb(41, 41, 41); }
|
||||
.cm-s-base16-light.CodeMirror .cm-table-row-even { background-color: rgb(234, 234, 234); }
|
||||
.cm-s-bespin.CodeMirror .cm-table-row-even { background-color: rgb(52, 45, 40); }
|
||||
.cm-s-blackboard.CodeMirror .cm-table-row-even { background-color: rgb(36, 39, 55); }
|
||||
.cm-s-cobalt.CodeMirror .cm-table-row-even { background-color: rgb(26, 56, 83); }
|
||||
.cm-s-colorforth.CodeMirror .cm-table-row-even { background-color: rgb(25, 25, 25); }
|
||||
.cm-s-darcula.CodeMirror .cm-table-row-even { background-color: rgb(56, 57, 59); }
|
||||
.cm-s-dracula.CodeMirror .cm-table-row-even { background-color: rgb(61, 63, 73); }
|
||||
.cm-s-duotone-dark.CodeMirror .cm-table-row-even { background-color: rgb(49, 45, 60); }
|
||||
.cm-s-duotone-light.CodeMirror .cm-table-row-even { background-color: rgb(246, 243, 238); }
|
||||
.cm-s-erlang-dark.CodeMirror .cm-table-row-even { background-color: rgb(26, 56, 83); }
|
||||
.cm-s-gruvbox-dark.CodeMirror .cm-table-row-even { background-color: rgb(55, 53, 51); }
|
||||
.cm-s-hopscotch.CodeMirror .cm-table-row-even { background-color: rgb(66, 58, 65); }
|
||||
.cm-s-isotope.CodeMirror .cm-table-row-even { background-color: rgb(22, 22, 22); }
|
||||
.cm-s-lesser-dark.CodeMirror .cm-table-row-even { background-color: rgb(58, 58, 57); }
|
||||
.cm-s-liquibyte.CodeMirror .cm-table-row-even { background-color: rgb(26, 26, 26); }
|
||||
.cm-s-lucario.CodeMirror .cm-table-row-even { background-color: rgb(64, 81, 96); }
|
||||
.cm-s-material.CodeMirror .cm-table-row-even { background-color: rgb(58, 69, 74); }
|
||||
.cm-s-mbo.CodeMirror .cm-table-row-even { background-color: rgb(65, 65, 63); }
|
||||
.cm-s-midnight.CodeMirror .cm-table-row-even { background-color: rgb(34, 46, 63); }
|
||||
.cm-s-monokai.CodeMirror .cm-table-row-even { background-color: rgb(60, 61, 55); }
|
||||
.cm-s-neo.CodeMirror .cm-table-row-even { background-color: rgb(245, 245, 245); }
|
||||
.cm-s-night.CodeMirror .cm-table-row-even { background-color: rgb(34, 25, 53); }
|
||||
.cm-s-oceanic-next.CodeMirror .cm-table-row-even { background-color: rgb(68, 83, 89); }
|
||||
.cm-s-paraiso-dark.CodeMirror .cm-table-row-even { background-color: rgb(61, 45, 59); }
|
||||
.cm-s-paraiso-light.CodeMirror .cm-table-row-even { background-color: rgb(223, 224, 211); }
|
||||
.cm-s-pastel-on-dark.CodeMirror .cm-table-row-even { background-color: rgb(54, 51, 49); }
|
||||
.cm-s-railscasts.CodeMirror .cm-table-row-even { background-color: rgb(63, 63, 62); }
|
||||
.cm-s-rubyblue.CodeMirror .cm-table-row-even { background-color: rgb(41, 58, 73); }
|
||||
.cm-s-seti.CodeMirror .cm-table-row-even { background-color: rgb(40, 42, 43); }
|
||||
.cm-s-shadowfox.CodeMirror .cm-table-row-even { background-color: rgb(56, 56, 59); }
|
||||
.cm-s-solarized.CodeMirror .cm-table-row-even { background-color: rgb(242, 242, 242); }
|
||||
.cm-s-the-matrix.CodeMirror .cm-table-row-even { background-color: rgb(0, 26, 0); }
|
||||
.cm-s-tomorrow-night-bright.CodeMirror .cm-table-row-even { background-color: rgb(23, 23, 23); }
|
||||
.cm-s-tomorrow-night-eighties.CodeMirror .cm-table-row-even { background-color: rgb(20, 20, 20); }
|
||||
.cm-s-twilight.CodeMirror .cm-table-row-even { background-color: rgb(43, 43, 43); }
|
||||
.cm-s-vibrant-ink.CodeMirror .cm-table-row-even { background-color: rgb(26, 26, 26); }
|
||||
.cm-s-xq-dark.CodeMirror .cm-table-row-even { background-color: rgb(34, 25, 53); }
|
||||
.cm-s-yeti.CodeMirror .cm-table-row-even { background-color: rgb(235, 232, 230); }
|
||||
120
extra_scripts/codemirror/mode/bfm/bfm.js
vendored
120
extra_scripts/codemirror/mode/bfm/bfm.js
vendored
@@ -54,17 +54,34 @@
|
||||
return {
|
||||
baseState: CodeMirror.startState(baseMode),
|
||||
|
||||
fencedEndRE: null
|
||||
basePos: 0,
|
||||
baseCur: null,
|
||||
overlayPos: 0,
|
||||
overlayCur: null,
|
||||
streamSeen: null,
|
||||
|
||||
fencedEndRE: null,
|
||||
|
||||
inTable: false,
|
||||
rowIndex: 0
|
||||
}
|
||||
},
|
||||
copyState: function(s) {
|
||||
return {
|
||||
baseState: CodeMirror.copyState(baseMode, s.baseState),
|
||||
|
||||
basePos: s.basePos,
|
||||
baseCur: null,
|
||||
overlayPos: s.overlayPos,
|
||||
overlayCur: null,
|
||||
|
||||
fencedMode: s.fencedMode,
|
||||
fencedState: s.fencedMode ? CodeMirror.copyState(s.fencedMode, s.fencedState) : null,
|
||||
|
||||
fencedEndRE: s.fencedEndRE
|
||||
fencedEndRE: s.fencedEndRE,
|
||||
|
||||
inTable: s.inTable,
|
||||
rowIndex: s.rowIndex
|
||||
}
|
||||
},
|
||||
token: function(stream, state) {
|
||||
@@ -76,27 +93,108 @@
|
||||
state.fencedState = null
|
||||
|
||||
stream.pos = initialPos
|
||||
return baseMode.token(stream, state.baseState)
|
||||
}
|
||||
else {
|
||||
if (state.fencedMode) {
|
||||
return state.fencedMode.token(stream, state.fencedState)
|
||||
}
|
||||
|
||||
const match = stream.match(fencedCodeRE, true)
|
||||
if (match) {
|
||||
state.fencedEndRE = new RegExp(match[1] + '+ *$')
|
||||
|
||||
state.fencedMode = getMode(match[2], match[3], config, stream.lineOracle.doc.cm)
|
||||
if (state.fencedMode) {
|
||||
state.fencedState = CodeMirror.startState(state.fencedMode)
|
||||
}
|
||||
|
||||
stream.pos = initialPos
|
||||
}
|
||||
}
|
||||
|
||||
if (state.fencedMode) {
|
||||
return state.fencedMode.token(stream, state.fencedState)
|
||||
if (stream != state.streamSeen || Math.min(state.basePos, state.overlayPos) < stream.start) {
|
||||
state.streamSeen = stream
|
||||
state.basePos = state.overlayPos = stream.start
|
||||
}
|
||||
|
||||
if (stream.start == state.basePos) {
|
||||
state.baseCur = baseMode.token(stream, state.baseState)
|
||||
state.basePos = stream.pos
|
||||
}
|
||||
if (stream.start == state.overlayPos) {
|
||||
stream.pos = stream.start
|
||||
state.overlayCur = this.overlayToken(stream, state)
|
||||
state.overlayPos = stream.pos
|
||||
}
|
||||
stream.pos = Math.min(state.basePos, state.overlayPos)
|
||||
|
||||
if (state.overlayCur == null) {
|
||||
return state.baseCur
|
||||
}
|
||||
else if (state.baseCur != null && state.combineTokens) {
|
||||
return state.baseCur + ' ' + state.overlayCur
|
||||
}
|
||||
else {
|
||||
return state.overlayCur
|
||||
}
|
||||
},
|
||||
overlayToken: function(stream, state) {
|
||||
state.combineTokens = false
|
||||
|
||||
if (state.fencedEndRE && stream.match(state.fencedEndRE)) {
|
||||
state.fencedEndRE = null
|
||||
state.localMode = null
|
||||
state.localState = null
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
if (state.localMode) {
|
||||
return state.localMode.token(stream, state.localState) || ''
|
||||
}
|
||||
|
||||
const match = stream.match(fencedCodeRE, true)
|
||||
if (match) {
|
||||
state.fencedEndRE = new RegExp(match[1] + '+ *$')
|
||||
|
||||
state.fencedMode = getMode(match[2], match[3], config, stream.lineOracle.doc.cm)
|
||||
if (state.fencedMode) {
|
||||
state.fencedState = CodeMirror.startState(state.fencedMode)
|
||||
state.localMode = getMode(match[2], match[3], config, stream.lineOracle.doc.cm)
|
||||
if (state.localMode) {
|
||||
state.localState = CodeMirror.startState(state.localMode)
|
||||
}
|
||||
|
||||
stream.pos = initialPos
|
||||
return baseMode.token(stream, state.baseState)
|
||||
return null
|
||||
}
|
||||
|
||||
return baseMode.token(stream, state.baseState)
|
||||
state.combineTokens = true
|
||||
|
||||
if (state.inTable) {
|
||||
if (stream.match(/^\|/)) {
|
||||
++state.rowIndex
|
||||
|
||||
stream.skipToEnd()
|
||||
|
||||
if (state.rowIndex === 1) {
|
||||
return 'table table-separator'
|
||||
} else if (state.rowIndex % 2 === 0) {
|
||||
return 'table table-row table-row-even'
|
||||
} else {
|
||||
return 'table table-row table-row-odd'
|
||||
}
|
||||
} else {
|
||||
state.inTable = false
|
||||
|
||||
stream.skipToEnd()
|
||||
return null
|
||||
}
|
||||
} else if (stream.match(/^\|/)) {
|
||||
state.inTable = true
|
||||
state.rowIndex = 0
|
||||
|
||||
stream.skipToEnd()
|
||||
return 'table table-header'
|
||||
}
|
||||
|
||||
stream.next()
|
||||
},
|
||||
electricChars: baseMode.electricChars,
|
||||
innerMode: function(state) {
|
||||
|
||||
Reference in New Issue
Block a user