Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/assets/stylesheets/lexxy-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
31 changes: 31 additions & 0 deletions test/browser/tests/formatting/blockquote_nested_emphasis.test.js
Original file line number Diff line number Diff line change
@@ -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("<blockquote><p>Quoted <em>emphasized</em> text</p></blockquote>")
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("<blockquote><p>Quoted <strong><em>emphasized</em></strong> text</p></blockquote>")
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")
})
})