in richtext-ui/src/commonMain/kotlin/com/halilibo/richtext/ui/string/RichTextString.kt [292:314]
public fun appendInlineContent(
alternateText: String = REPLACEMENT_CHAR,
content: InlineContent
) {
val tag = randomUUID()
formatObjects["inline:$tag"] = content
// Resets the style to defaults.
//
// This is important for inline content because the user might set a global line height
// via ProvideTextStyle(TextStyle(lineHeight = 1.3.em)) { ... }
// Once set, the line height is fixed for all objects and any inline content (like images)
// will expand over the text. Since this is not a text section, it should be fine.
//
// Fixed line height seems to only affect mobile.
if (content.renderOnNewLine) {
builder.pushStyle(ParagraphStyle())
}
builder.appendInlineContent(tag, alternateText)
if (content.renderOnNewLine) {
builder.pop()
}
}