[JEWEL-870] Render images in Markdown headers

closes https://github.com/JetBrains/intellij-community/pull/3113

GitOrigin-RevId: 0138fd0e3d00072975fff9f6e6e904e2a89af8dd
This commit is contained in:
Alexander Kuznetsov
2025-07-08 20:16:50 +00:00
committed by intellij-monorepo-bot
parent 55fb56e4ac
commit e4a26b067b
@@ -187,6 +187,7 @@ public open class DefaultMarkdownBlockRenderer(
) {
val renderedContent = rememberRenderedContent(block, styling.inlinesStyling, enabled, onUrlClick)
Heading(
block,
renderedContent,
styling.inlinesStyling.textStyle,
styling.padding,
@@ -199,6 +200,7 @@ public open class DefaultMarkdownBlockRenderer(
@Composable
private fun Heading(
block: Heading,
renderedContent: AnnotatedString,
textStyle: TextStyle,
paddingValues: PaddingValues,
@@ -210,7 +212,12 @@ public open class DefaultMarkdownBlockRenderer(
Column(modifier = modifier.padding(paddingValues)) {
val textColor = textStyle.color.takeOrElse { LocalContentColor.current.takeOrElse { textStyle.color } }
val mergedStyle = textStyle.merge(TextStyle(color = textColor))
Text(text = renderedContent, style = mergedStyle, modifier = Modifier.focusProperties { canFocus = false })
Text(
text = renderedContent,
style = mergedStyle,
modifier = Modifier.focusProperties { canFocus = false },
inlineContent = renderedImages(block),
)
if (underlineWidth > 0.dp && underlineColor.isSpecified) {
Spacer(Modifier.height(underlineGap))