From b706f5b5eb703e948d9a66a3fe8c07ba415e5071 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Mon, 29 Jan 2024 21:09:45 -0700 Subject: [PATCH] Remove AndDown code --- .../wbrawner/simplemarkdown/ui/MarkdownInfoScreen.kt | 3 +-- .../com/wbrawner/simplemarkdown/utility/Extensions.kt | 11 ----------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownInfoScreen.kt b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownInfoScreen.kt index 825c591..877a0d5 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownInfoScreen.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownInfoScreen.kt @@ -11,7 +11,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.navigation.NavController import com.wbrawner.simplemarkdown.utility.readAssetToString -import com.wbrawner.simplemarkdown.utility.toHtml @Composable fun MarkdownInfoScreen( @@ -30,7 +29,7 @@ fun MarkdownInfoScreen( val context = LocalContext.current val (markdown, setMarkdown) = remember { mutableStateOf("") } LaunchedEffect(file) { - setMarkdown(context.assets.readAssetToString(file)?.toHtml() ?: "Failed to load $file") + setMarkdown(context.assets.readAssetToString(file) ?: "Failed to load $file") } MarkdownPreview( modifier = Modifier diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/utility/Extensions.kt b/app/src/main/java/com/wbrawner/simplemarkdown/utility/Extensions.kt index 1194c38..a3ea912 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/utility/Extensions.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/utility/Extensions.kt @@ -6,7 +6,6 @@ import android.net.Uri import android.provider.OpenableColumns import android.view.View import android.view.inputmethod.InputMethodManager -import com.commonsware.cwac.anddown.AndDown import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.io.Reader @@ -27,16 +26,6 @@ suspend fun AssetManager.readAssetToString(asset: String): String? { } } -const val HOEDOWN_FLAGS = AndDown.HOEDOWN_EXT_STRIKETHROUGH or AndDown.HOEDOWN_EXT_TABLES or - AndDown.HOEDOWN_EXT_UNDERLINE or AndDown.HOEDOWN_EXT_SUPERSCRIPT or - AndDown.HOEDOWN_EXT_FENCED_CODE - -suspend fun String.toHtml(): String { - return withContext(Dispatchers.IO) { - AndDown().markdownToHtml(this@toHtml, HOEDOWN_FLAGS, 0) - } -} - suspend fun Uri.getName(context: Context): String { var fileName: String? = null try {