Skip to content

Render emphasis upright inside italic blockquotes - #1215

Open
wintan1418 wants to merge 2 commits into
basecamp:mainfrom
wintan1418:fix-blockquote-nested-emphasis
Open

Render emphasis upright inside italic blockquotes#1215
wintan1418 wants to merge 2 commits into
basecamp:mainfrom
wintan1418:fix-blockquote-nested-emphasis

Conversation

@wintan1418

@wintan1418 wintan1418 commented Jul 30, 2026

Copy link
Copy Markdown

Fixes #939

Blockquotes are styled font-style: italic, and .lexxy-content__italic applies the same style — so <em> inside a quote is visually indistinguishable from the surrounding text. This follows the standard typographic convention of flipping nested emphasis back to upright so it stands out by contrast.

The new rule targets both:

  • plain <em> tags — exported Action Text content carries semantic tags, and hand-authored/imported HTML may have no classes at all
  • .lexxy-content__italic — the editor theme class, which also covers bold+italic runs that render as <strong class="…__italic"> with no <em> element

Nesting stays inside the existing :where(.lexxy-content) wrapper, so consumer overrides keep working the same way they do for the other blockquote rules.

Tests

Added a Playwright test asserting the computed font-style of emphasis inside a blockquote is normal while the quote itself stays italic, for both the plain-emphasis and bold+italic cases. The test fails on main and passes with this change.

Ran the full Playwright suite on Chromium (609 passed) and Firefox for this test; WebKit couldn't launch locally (missing system libraries), so relying on CI for that project. yarn lint is clean.

Blockquotes are styled italic, and emphasized text inside them picked up
the same font-style, leaving <em> visually indistinguishable from the
surrounding quote. Follow the typographic convention of flipping nested
emphasis back to upright so it stands out by contrast.

The rule targets both plain <em> tags (exported Action Text content) and
.lexxy-content__italic (the editor's theme class, which also covers
bold+italic runs rendered as <strong class="…__italic">).

Fixes basecamp#939
@wintan1418
wintan1418 force-pushed the fix-blockquote-nested-emphasis branch from 2b06431 to 1994ca1 Compare July 30, 2026 14:33
@wintan1418
wintan1418 marked this pull request as ready for review July 30, 2026 18:39
Copilot AI review requested due to automatic review settings July 30, 2026 18:39

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the lack of visual distinction for emphasis inside italic-styled blockquotes by flipping nested emphasis back to upright within Lexxy-rendered content, following standard typography conventions.

Changes:

  • Add a nested blockquote rule in lexxy-content.css to render em and .lexxy-content__italic as font-style: normal inside quotes.
  • Add a Playwright test covering computed font-style for both semantic <em> and theme-class (.lexxy-content__italic) cases inside blockquotes.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/browser/tests/formatting/blockquote_nested_emphasis.test.js Adds Playwright coverage asserting nested emphasis renders upright inside italic blockquotes.
app/assets/stylesheets/lexxy-content.css Updates blockquote styling so nested emphasis is visually distinct (upright) within italic quotes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +28
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 emphasis = editor.content.locator("blockquote .lexxy-content__italic")

await expect(emphasis).toHaveCSS("font-style", "normal")
})

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — the bold+italic test now also asserts the surrounding paragraph keeps font-style: italic, same as the first test. Fixed in 2cea824.

Guards against a regression where the blockquote's own italic styling
changes and the nested-emphasis test would still pass.
Copilot AI review requested due to automatic review settings July 30, 2026 18:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<em> inside <blockquote> has no visual distinction

2 participants