Html rendering: add padding to code blocks
This commit is contained in:
parent
58acc0d80b
commit
d2ab0872ec
1 changed files with 5 additions and 1 deletions
|
|
@ -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),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue