mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Html rendering: add padding to code blocks
This commit is contained in:
+5
-1
@@ -87,7 +87,11 @@ private fun HtmlPreformatted(pre: Element, modifier: Modifier = Modifier) {
|
|||||||
val isCode = pre.firstElementChild()?.normalName() == "code"
|
val isCode = pre.firstElementChild()?.normalName() == "code"
|
||||||
val backgroundColor =
|
val backgroundColor =
|
||||||
if (isCode) MaterialTheme.colorScheme.codeBackground() else Color.Unspecified
|
if (isCode) MaterialTheme.colorScheme.codeBackground() else Color.Unspecified
|
||||||
Box(modifier.background(color = backgroundColor)) {
|
Box(
|
||||||
|
modifier
|
||||||
|
.background(color = backgroundColor)
|
||||||
|
.padding(horizontal = 8.dp)
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = pre.wholeText(),
|
text = pre.wholeText(),
|
||||||
style = TextStyle(fontFamily = FontFamily.Monospace),
|
style = TextStyle(fontFamily = FontFamily.Monospace),
|
||||||
|
|||||||
Reference in New Issue
Block a user