diff --git a/app/assets/stylesheets/lexxy-content.css b/app/assets/stylesheets/lexxy-content.css index 6a06d9539..5a5b61677 100644 --- a/app/assets/stylesheets/lexxy-content.css +++ b/app/assets/stylesheets/lexxy-content.css @@ -77,6 +77,11 @@ margin: var(--lexxy-content-margin) 0; padding: 0.5lh 2ch; + em, + .lexxy-content__italic { + font-style: normal; + } + p:last-child { margin-block-end: 0; } diff --git a/test/browser/tests/formatting/blockquote_nested_emphasis.test.js b/test/browser/tests/formatting/blockquote_nested_emphasis.test.js new file mode 100644 index 000000000..647173811 --- /dev/null +++ b/test/browser/tests/formatting/blockquote_nested_emphasis.test.js @@ -0,0 +1,31 @@ +import { test } from "../../test_helper.js" +import { expect } from "@playwright/test" + +test.describe("Emphasis inside blockquotes", () => { + test.beforeEach(async ({ page }) => { + await page.goto("/") + await page.waitForSelector("lexxy-editor[connected]") + }) + + test("renders emphasized text upright inside an italic blockquote", async ({ editor }) => { + await editor.setValue("
") + await editor.flush() + + const paragraph = editor.content.locator("blockquote p") + const emphasis = editor.content.locator("blockquote em") + + await expect(paragraph).toHaveCSS("font-style", "italic") + await expect(emphasis).toHaveCSS("font-style", "normal") + }) + + test("renders bold emphasized text upright inside an italic blockquote", async ({ editor }) => { + await editor.setValue("Quoted emphasized text
") + await editor.flush() + + const paragraph = editor.content.locator("blockquote p") + const emphasis = editor.content.locator("blockquote .lexxy-content__italic") + + await expect(paragraph).toHaveCSS("font-style", "italic") + await expect(emphasis).toHaveCSS("font-style", "normal") + }) +})Quoted emphasized text