mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
Fix 63749 - Markdown, U+2028, and "Go to Symbol in File..." (#63936)
* fix-63749 - Added UNICODE_NEWLINE_REGEX * fix-63749 - Removed .skip for the test method * fix-63749 Moved Replace to parse
This commit is contained in:
committed by
Matt Bierner
parent
de4c52a612
commit
e05aa178d6
@@ -109,13 +109,14 @@ export class MarkdownEngine {
|
||||
}
|
||||
|
||||
public async parse(document: vscode.Uri, source: string): Promise<Token[]> {
|
||||
const UNICODE_NEWLINE_REGEX = /\u2028|\u2029/g;
|
||||
const { text, offset } = this.stripFrontmatter(source);
|
||||
this.currentDocument = document;
|
||||
this._slugCount = new Map<string, number>();
|
||||
|
||||
const engine = await this.getEngine(document);
|
||||
|
||||
return engine.parse(text, {}).map(token => {
|
||||
return engine.parse(text.replace(UNICODE_NEWLINE_REGEX, ''), {}).map(token => {
|
||||
if (token.map) {
|
||||
token.map[0] += offset;
|
||||
token.map[1] += offset;
|
||||
|
||||
@@ -83,7 +83,7 @@ suite('markdown.DocumentSymbolProvider', () => {
|
||||
assert.strictEqual(symbols[0].children[1].name, '## h3');
|
||||
});
|
||||
|
||||
test.skip('Should handle line separator in file. Issue #63749', async () => {
|
||||
test('Should handle line separator in file. Issue #63749', async () => {
|
||||
const symbols = await getSymbolsForFile(`# A
|
||||
- foo
|
||||
|
||||
|
||||
Reference in New Issue
Block a user