mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Markdown region folding (#55399)
* Add foldin g of regions to markdown * Add test for region folding * Tweak region identification regex
This commit is contained in:
committed by
Matt Bierner
parent
868140430d
commit
6a1515671f
@@ -78,6 +78,31 @@ y`);
|
||||
assert.strictEqual(firstFold.end, 2);
|
||||
});
|
||||
|
||||
test('Should fold nested <!-- #region --> markers', async () => {
|
||||
const folds = await getFoldsForDocument(`a
|
||||
<!-- #region -->
|
||||
b
|
||||
<!-- #region hello!-->
|
||||
b.a
|
||||
<!-- #endregion -->
|
||||
b
|
||||
<!-- #region: foo! -->
|
||||
b.b
|
||||
<!-- #endregion: foo -->
|
||||
b
|
||||
<!-- #endregion -->
|
||||
a`);
|
||||
assert.strictEqual(folds.length, 3);
|
||||
const [outer, first, second] = folds.sort((a, b) => a.start - b.start);
|
||||
|
||||
assert.strictEqual(outer.start, 1);
|
||||
assert.strictEqual(outer.end, 11);
|
||||
assert.strictEqual(first.start, 3);
|
||||
assert.strictEqual(first.end, 5);
|
||||
assert.strictEqual(second.start, 7);
|
||||
assert.strictEqual(second.end, 9);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user