Skip to content

refactor(api): rename paragraph inline svg/emoji adders to inlineSvgIcon/inlineEmoji#221

Merged
DemchaAV merged 2 commits into
developfrom
feat/inline-svg-rename-wrap-tests
Jun 22, 2026
Merged

refactor(api): rename paragraph inline svg/emoji adders to inlineSvgIcon/inlineEmoji#221
DemchaAV merged 2 commits into
developfrom
feat/inline-svg-rename-wrap-tests

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

ParagraphBuilder's inline adders are named inlineText / inlineImage /
inlineLink / inlineLinkTo, but the two newest — svgIcon(...) and
emoji(...) — broke that convention, so one builder mixed two naming styles
for inline runs. The methods are @since 1.9.0 and unreleased, so the names
are still free to change.

Separately, InlineSvgRenderTest only exercised single-line paragraphs,
leaving the inline-SVG wrap and pagination paths untested: wrapInlineParagraph
runs an InlineSvgToken through the greedy width-fit and toInlineParagraphLine
drives each line's height off that token, but nothing asserted an icon that
lands on a wrapped line or crosses a page break.

What changed

  • Rename ParagraphBuilder.svgIcon(...)inlineSvgIcon(...) and
    emoji(...)inlineEmoji(...) (all overloads), restoring the inline*
    convention. RichText.svgIcon / RichText.emoji keep their bare names —
    internally consistent there. No deprecation bridge: the methods are
    unreleased. Callers in examples/, the tests, the emoji package-info and
    the in-progress CHANGELOG bullets are updated to match.
  • Add two InlineSvgRenderTest cases:
    • inlineSvgIconWrapsAcrossLinesAndDrivesLineHeight — a tall icon on a
      narrow column; asserts the paragraph wraps to ≥2 lines, the icon's line
      carries a ParagraphSvgSpan, and that line's lineHeight() exceeds its
      textLineHeight() (the icon, not the text, drove the height), then that
      the icon actually paints.
    • inlineSvgIconSplitAcrossPagesRendersAndPaints — a paginating paragraph;
      asserts ≥2 pages and the icon still paints on its head page.

Verification

./mvnw test -pl .BUILD SUCCESS, 1466 tests (InlineSvgRenderTest 9,
EmojiRenderTest 4). ./mvnw -f examples/pom.xml compileBUILD SUCCESS
(examples build against the renamed API).

Lane: canonical (document.dsl) + test — public-API rename of unreleased methods, plus inline-SVG wrap/pagination coverage.

Independent of the other open branches.

…nlineEmoji

ParagraphBuilder's inline adders now follow the existing inlineText /
inlineImage / inlineLink convention: svgIcon -> inlineSvgIcon and
emoji -> inlineEmoji (all overloads). RichText keeps its bare svgIcon /
emoji names, which are internally consistent there. The API is unreleased
(@SInCE 1.9.0), so there is no deprecation bridge.

Also adds two InlineSvgRenderTest cases for inline-SVG paths that only
single-line paragraphs reached before: an icon that wraps onto a later
line (asserting that line grows to the icon via lineHeight > textLineHeight)
and an icon inside a paragraph that splits across a page break (it still
paints on its head page).
@DemchaAV DemchaAV merged commit 89e7ff8 into develop Jun 22, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/inline-svg-rename-wrap-tests branch June 22, 2026 15:01
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.

1 participant