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..058f898218 --- /dev/null +++ b/change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "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" +} diff --git a/package-lock.json b/package-lock.json index 0eef6728d3..ccc5e2fac0 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 8527dd0d5c..4e02a75876 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