Skip to content

fix(web): keep styled spans inside exported inline links inline - #2663

Merged
Hona merged 1 commit into
devfrom
fix/web-export-inline-links
Nov 27, 2026
Merged

Hona merged 1 commit into
devfrom
fix/web-export-inline-links

Conversation

@Hona

@Hona Hona commented Nov 27, 2026

Copy link
Copy Markdown
Member

Fixes #2655.

Cause

BASE_CSS in crates/rune/src/runtime/web/export/page.rs sets display: flex; position: relative on [data-rune-static] * and previously reset only direct children of a text element ([data-rune-static] .t>*{display:inline;position:static}).

When a paragraph or heading contains a styled inline link, css::text_html emits <a href="..."><span style="...">...</span></a>. Because the <span> is a grandchild of .t, it missed .t>*, inherited display: flex, and caused CSS block-in-inline splitting that put the linked text on its own line.

Change

  • Broaden the text-run inline reset in BASE_CSS from [data-rune-static] .t>* to [data-rune-static] .t * so <a> elements and any styled <span> runs nested inside them stay display: inline; position: static.
  • Standalone link containers (El::href on a container) do not carry or sit inside .t, so they keep their flex layout while any nested rich-text children keep their own .t scope.
  • Add a unit test covering styled inline links in paragraphs and headings alongside standalone flex link containers.
  • Add changelog/unreleased/2026-11-28-web-export-inline-links.md.

Verification

  • cargo test -p rune --lib runtime::web::export (14 passed)
  • cargo test -p rune --lib tooling::html (3 passed)
  • cargo check -p rune --target wasm32-unknown-unknown (passed)
  • Live browser visual inspection was not run locally.

@Hona
Hona force-pushed the fix/web-export-inline-links branch from 7b4bf57 to a7489d8 Compare November 27, 2026 22:21
@Hona
Hona merged commit 99d16cc into dev Nov 27, 2026
4 checks passed
@Hona
Hona deleted the fix/web-export-inline-links branch November 27, 2026 22:21
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.

Web: a link inside exported paragraph text is laid out on its own line

1 participant