From aa37e17423137d2b27008bb83f8bccdf8a2a2728 Mon Sep 17 00:00:00 2001 From: Marina Miyaoka <37388187+miyaokamarina@users.noreply.github.com> Date: Thu, 10 Nov 2022 22:46:43 +0300 Subject: [PATCH] Do not preprocess Unicode newlines in Markdown preview (#166026) Revert LS PS preprocessing in Markdown preview --- extensions/markdown-language-features/src/markdownEngine.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/markdown-language-features/src/markdownEngine.ts b/extensions/markdown-language-features/src/markdownEngine.ts index 8712dfc9985..5b17f49fc4c 100644 --- a/extensions/markdown-language-features/src/markdownEngine.ts +++ b/extensions/markdown-language-features/src/markdownEngine.ts @@ -13,8 +13,6 @@ import { ITextDocument } from './types/textDocument'; import { WebviewResourceProvider } from './util/resources'; import { isOfScheme, Schemes } from './util/schemes'; -const UNICODE_NEWLINE_REGEX = /\u2028|\u2029/g; - /** * Adds begin line index to the output via the 'data-line' data attribute. */ @@ -189,7 +187,7 @@ export class MarkdownItEngine implements IMdParser { private _tokenizeString(text: string, engine: MarkdownIt) { this._resetSlugCount(); - return engine.parse(text.replace(UNICODE_NEWLINE_REGEX, ''), {}); + return engine.parse(text, {}); } private _resetSlugCount(): void {