From 06cbc5ec312e4bcb89169e38d8b7b326371642e9 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Thu, 11 Jul 2024 22:24:13 -0600 Subject: [PATCH] Fix padding and link color for HtmlText --- .../java/com/wbrawner/simplemarkdown/ui/MarkdownText.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownText.kt b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownText.kt index c4f1e51..82ee9f2 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownText.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownText.kt @@ -3,6 +3,7 @@ package com.wbrawner.simplemarkdown.ui import android.view.ViewGroup import android.webkit.WebView import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.rememberScrollState @@ -62,8 +63,9 @@ fun MarkdownText(modifier: Modifier = Modifier, markdown: String) { modifier = modifier .fillMaxSize() .verticalScroll(rememberScrollState()), + verticalArrangement = Arrangement.Top ) { - HtmlText(modifier = modifier, html = html) + HtmlText(html = html) } } @@ -76,6 +78,9 @@ fun HtmlText(html: String, modifier: Modifier = Modifier) { | background: #${materialColors.surface.toArgb().toHexString().substring(2)}; | color: #${materialColors.onSurface.toArgb().toHexString().substring(2)}; |} + |a { + | color: #${materialColors.secondary.toArgb().toHexString().substring(2)}; + |} |pre { | background: #${materialColors.surfaceVariant.toArgb().toHexString().substring(2)}; | color: #${materialColors.onSurfaceVariant.toArgb().toHexString().substring(2)};