Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 63749 - Markdown, U+2028, and "Go to Symbol in File..." #63936

Merged
merged 3 commits into from Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion extensions/markdown-language-features/src/markdownEngine.ts
Expand Up @@ -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;
Expand Down
Expand Up @@ -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


Expand Down