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: '
  1. Numbered list

', From db68ecdd5fd217d5dfbb408565327dd3e1235b10 Mon Sep 17 00:00:00 2001 From: Vivin Krishna <123377523+vivinkrishna-ni@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:30:25 +0530 Subject: [PATCH 2/3] Change files --- ...le-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json diff --git a/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json b/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json new file mode 100644 index 0000000000..def6adde9a --- /dev/null +++ b/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Update dependency on prosemirror-markdown", + "packageName": "@ni/nimble-components", + "email": "123377523+vivinkrishna-ni@users.noreply.github.com", + "dependentChangeType": "patch" +} From 9105756a94fb9d22492911be2951f93bd8b7c78c Mon Sep 17 00:00:00 2001 From: Vivin Krishna <123377523+vivinkrishna-ni@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:13:53 +0530 Subject: [PATCH 3/3] Update description for the change file Co-authored-by: vikisekarNI <94439533+vikisekarNI@users.noreply.github.com> --- ...-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json b/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json index def6adde9a..058f898218 100644 --- a/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json +++ b/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json @@ -1,6 +1,6 @@ { "type": "patch", - "comment": "Update dependency on prosemirror-markdown", + "comment": "Mixed bold and italics formatting corner cases fixed. Update dependency on prosemirror-markdown", "packageName": "@ni/nimble-components", "email": "123377523+vivinkrishna-ni@users.noreply.github.com", "dependentChangeType": "patch"