From cd2fe5f55da4ac1a93bd2b98502dbe739510a227 Mon Sep 17 00:00:00 2001 From: Vivin Krishna <123377523+vivinkrishna-ni@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:25:46 +0530 Subject: [PATCH 1/3] Bumped prosemirror-markdown to 1.11.2 and updated test cases in serializer --- package-lock.json | 8 ++-- packages/nimble-components/package.json | 2 +- .../models/tests/markdown-serializer.spec.ts | 40 +++++++++++++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index b7ea012477..3352bbaa77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28065,9 +28065,9 @@ } }, "node_modules/prosemirror-markdown": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.11.0.tgz", - "integrity": "sha512-yP9mZqPRstjZhhf3yykCQNE3AijxARrHe4e7esV9A+gp4cnGOH4QvrKYPpXLHspNWyvJJ+0URH+iIvV5qP1I2Q==", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.11.2.tgz", + "integrity": "sha512-Eu5g4WPiCdqDTGhdSsG9N6ZjACQRYrsAkrF9KYfdMaCmjIApH75aVncsWYOJvEk2i1B3i8jZppv3J/tnuHGiUQ==", "dependencies": { "markdown-it": "^13.0.1", "prosemirror-model": "^1.0.0" @@ -34750,7 +34750,7 @@ "d3-scale": "^4.0.2", "d3-selection": "^3.0.0", "d3-zoom": "^3.0.0", - "prosemirror-markdown": "^1.11.0", + "prosemirror-markdown": "^1.11.2", "prosemirror-model": "^1.19.2", "tslib": "^2.2.0" }, diff --git a/packages/nimble-components/package.json b/packages/nimble-components/package.json index 691894ce5e..369f4d655c 100644 --- a/packages/nimble-components/package.json +++ b/packages/nimble-components/package.json @@ -86,7 +86,7 @@ "d3-scale": "^4.0.2", "d3-selection": "^3.0.0", "d3-zoom": "^3.0.0", - "prosemirror-markdown": "^1.11.0", + "prosemirror-markdown": "^1.11.2", "prosemirror-model": "^1.19.2", "tslib": "^2.2.0" }, diff --git a/packages/nimble-components/src/rich-text/models/tests/markdown-serializer.spec.ts b/packages/nimble-components/src/rich-text/models/tests/markdown-serializer.spec.ts index 1c60d696c0..3b3afbb556 100644 --- a/packages/nimble-components/src/rich-text/models/tests/markdown-serializer.spec.ts +++ b/packages/nimble-components/src/rich-text/models/tests/markdown-serializer.spec.ts @@ -56,6 +56,46 @@ describe('Markdown serializer', () => { html: 'Bold and Italics', markdown: '***Bold and Italics***' }, + { + name: 'Italics without spaces in between bold texts', + html: 'Bolditalicsbold', + markdown: '**Bold*italics*bold**' + }, + { + name: 'Italics with leading and trailing spaces in between bold texts', + html: 'Bold italics bold', + markdown: '**Bold *italics* bold**' + }, + { + name: 'Bold and italics with leading and trailing spaces in italics with isolated italics at the end', + html: 'Bold italics italics', + markdown: '**Bold *italics*** *italics*' + }, + { + name: 'Bold and italics with leading and trailing spaces in bold with isolated italics at the end', + html: ' Bold italics italics', + markdown: '**Bold *italics*** *italics*' + }, + { + name: 'Bold and italics with leading and trailing spaces in both', + html: 'Bold italics bold italics italics', + markdown: '**Bold *italics* bold *italics*** *italics*' + }, + { + name: 'Bold without spaces in between italics texts', + html: 'Italicsbolditalics', + markdown: '*Italics**bold**italics*' + }, + { + name: 'Bold with leading and trailing spaces in between italics texts', + html: 'Italics bold italics', + markdown: '*Italics **bold** italics*' + }, + { + name: 'Italics and bold with leading and trailing spaces in bold with isolated bold at the end', + html: 'Italics bold bold', + markdown: '*Italics **bold*** **bold**' + }, { name: 'Numbered list', html: '
Numbered list