mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #5836 from overleaf/jk-cm-code-folding-again
[web] Add code folding to CodeMirror 6 GitOrigin-RevId: b6dcc5dbdda2676debeb986bd738b6dd1232fd5a
This commit is contained in:
parent
9e331d1176
commit
4d5829dddf
1 changed files with 6 additions and 1 deletions
|
@ -34,6 +34,11 @@ const MATCHER = new RegExp(
|
|||
|
||||
function matchOutline(content) {
|
||||
const lines = content.split('\n')
|
||||
const flatOutline = matchOutlineFromLines(lines)
|
||||
return flatOutline
|
||||
}
|
||||
|
||||
function matchOutlineFromLines(lines) {
|
||||
const flatOutline = []
|
||||
lines.forEach((line, lineId) => {
|
||||
const match = line.match(MATCHER)
|
||||
|
@ -125,4 +130,4 @@ function nestOutline(flatOutline) {
|
|||
return nestedOutlines
|
||||
}
|
||||
|
||||
export { matchOutline, nestOutline }
|
||||
export { matchOutline, matchOutlineFromLines, nestOutline }
|
||||
|
|
Loading…
Reference in a new issue