diff --git a/gradle.properties b/gradle.properties index 44f8ca67..738a6912 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Maven stuff GROUP=com.mikepenz -VERSION_NAME=0.39.0 -VERSION_CODE=3900 +VERSION_NAME=0.39.1 +VERSION_CODE=3901 # POM_URL=https://github.com/mikepenz/multiplatform-markdown-renderer POM_SCM_URL=https://github.com/mikepenz/multiplatform-markdown-renderer @@ -34,8 +34,6 @@ org.jetbrains.compose.experimental.wasm.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true -# Screenshot test -android.experimental.enableScreenshotTest=true # Dokka org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true diff --git a/multiplatform-markdown-renderer-code/build.gradle.kts b/multiplatform-markdown-renderer-code/build.gradle.kts index b303d770..a520811d 100644 --- a/multiplatform-markdown-renderer-code/build.gradle.kts +++ b/multiplatform-markdown-renderer-code/build.gradle.kts @@ -1,19 +1,22 @@ plugins { - id("com.mikepenz.convention.android-library") id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.convention.publishing") } -android { - namespace = "com.mikepenz.markdown.code" -} +kotlin { + android { + namespace = "com.mikepenz.markdown.code" + } -dependencies { - commonMainApi(projects.multiplatformMarkdownRenderer) - commonMainCompileOnly(compose.runtime) - commonMainCompileOnly(compose.ui) - commonMainCompileOnly(compose.foundation) + sourceSets { + commonMain.dependencies { + api(projects.multiplatformMarkdownRenderer) + compileOnly(baseLibs.jetbrains.compose.runtime) + compileOnly(baseLibs.jetbrains.compose.ui) + compileOnly(baseLibs.jetbrains.compose.foundation) - commonMainApi(libs.highlights) -} \ No newline at end of file + api(libs.highlights) + } + } +} diff --git a/multiplatform-markdown-renderer-coil2/build.gradle.kts b/multiplatform-markdown-renderer-coil2/build.gradle.kts index e00d9a61..a6ab8810 100644 --- a/multiplatform-markdown-renderer-coil2/build.gradle.kts +++ b/multiplatform-markdown-renderer-coil2/build.gradle.kts @@ -1,18 +1,22 @@ plugins { - id("com.mikepenz.convention.android-library") id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.convention.publishing") } -android { - namespace = "com.mikepenz.markdown.coil2" -} - -dependencies { - commonMainApi(projects.multiplatformMarkdownRenderer) - commonMainCompileOnly(compose.runtime) - commonMainCompileOnly(compose.ui) +kotlin { + android { + namespace = "com.mikepenz.markdown.coil2" + } + sourceSets { + commonMain.dependencies { + api(projects.multiplatformMarkdownRenderer) + compileOnly(baseLibs.jetbrains.compose.runtime) + compileOnly(baseLibs.jetbrains.compose.ui) + } - androidMainApi(libs.coil2.core) + androidMain.dependencies { + api(libs.coil2.core) + } + } } diff --git a/multiplatform-markdown-renderer-coil3/build.gradle.kts b/multiplatform-markdown-renderer-coil3/build.gradle.kts index dcf36de4..9734ccd8 100644 --- a/multiplatform-markdown-renderer-coil3/build.gradle.kts +++ b/multiplatform-markdown-renderer-coil3/build.gradle.kts @@ -1,19 +1,20 @@ plugins { - id("com.mikepenz.convention.android-library") id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.convention.publishing") } -android { - namespace = "com.mikepenz.markdown.coil3" -} - -dependencies { - commonMainApi(projects.multiplatformMarkdownRenderer) - - commonMainApi(libs.coil.core) { - exclude(group = "org.jetbrains.compose.runtime") +kotlin { + android { + namespace = "com.mikepenz.markdown.coil3" + } + sourceSets { + commonMain.dependencies { + api(projects.multiplatformMarkdownRenderer) + api(libs.coil.core.get().toString()) { + exclude(group = "org.jetbrains.compose.runtime") + } + compileOnly(baseLibs.jetbrains.compose.runtime) + } } - commonMainCompileOnly(compose.runtime) } diff --git a/multiplatform-markdown-renderer-m2/build.gradle.kts b/multiplatform-markdown-renderer-m2/build.gradle.kts index 482bba57..2b464689 100644 --- a/multiplatform-markdown-renderer-m2/build.gradle.kts +++ b/multiplatform-markdown-renderer-m2/build.gradle.kts @@ -1,18 +1,20 @@ plugins { - id("com.mikepenz.convention.android-library") id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.convention.publishing") } -android { - namespace = "com.mikepenz.markdown.m2" -} - -dependencies { - commonMainApi(projects.multiplatformMarkdownRenderer) - commonMainApi(libs.markdown) +kotlin { + android { + namespace = "com.mikepenz.markdown.m2" + } + sourceSets { + commonMain.dependencies { + api(projects.multiplatformMarkdownRenderer) + api(libs.markdown) - commonMainCompileOnly(compose.runtime) - commonMainCompileOnly(compose.material) -} \ No newline at end of file + compileOnly(baseLibs.jetbrains.compose.runtime) + compileOnly(baseLibs.jetbrains.compose.material) + } + } +} diff --git a/multiplatform-markdown-renderer-m3/build.gradle.kts b/multiplatform-markdown-renderer-m3/build.gradle.kts index 66590c20..701887f5 100644 --- a/multiplatform-markdown-renderer-m3/build.gradle.kts +++ b/multiplatform-markdown-renderer-m3/build.gradle.kts @@ -1,18 +1,20 @@ plugins { - id("com.mikepenz.convention.android-library") id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.convention.publishing") } -android { - namespace = "com.mikepenz.markdown.m3" -} - -dependencies { - commonMainApi(projects.multiplatformMarkdownRenderer) - commonMainApi(libs.markdown) +kotlin { + android { + namespace = "com.mikepenz.markdown.m3" + } + sourceSets { + commonMain.dependencies { + api(projects.multiplatformMarkdownRenderer) + api(libs.markdown) - commonMainCompileOnly(compose.runtime) - commonMainCompileOnly(compose.material3) -} \ No newline at end of file + compileOnly(baseLibs.jetbrains.compose.runtime) + compileOnly(baseLibs.jetbrains.compose.material3) + } + } +} diff --git a/multiplatform-markdown-renderer/build.gradle.kts b/multiplatform-markdown-renderer/build.gradle.kts index 88497c63..a24b4138 100644 --- a/multiplatform-markdown-renderer/build.gradle.kts +++ b/multiplatform-markdown-renderer/build.gradle.kts @@ -1,23 +1,26 @@ plugins { - id("com.mikepenz.convention.android-library") id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.convention.publishing") } -android { - namespace = "com.mikepenz.markdown" +kotlin { + android { + namespace = "com.mikepenz.markdown" + } + + sourceSets { + commonMain.dependencies { + api(libs.markdown) + api(baseLibs.kotlinx.collections.immutable) + + compileOnly(baseLibs.jetbrains.compose.runtime) + compileOnly(baseLibs.jetbrains.compose.ui) + compileOnly(baseLibs.jetbrains.compose.foundation) + } + } } composeCompiler { stabilityConfigurationFiles.add(project.layout.projectDirectory.file("stability_config.conf")) } - -dependencies { - commonMainApi(libs.markdown) - commonMainApi(baseLibs.kotlinx.collections.immutable) - - commonMainCompileOnly(compose.runtime) - commonMainCompileOnly(compose.ui) - commonMainCompileOnly(compose.foundation) -} \ No newline at end of file diff --git a/multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/annotator/AnnotatedStringKtx.kt b/multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/annotator/AnnotatedStringKtx.kt index f54f0f6b..60284d10 100644 --- a/multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/annotator/AnnotatedStringKtx.kt +++ b/multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/annotator/AnnotatedStringKtx.kt @@ -183,8 +183,12 @@ fun AnnotatedString.Builder.appendMarkdownReference( buildMarkdownAnnotatedString(content, linkText.mapAutoLinkToType(), annotatorSettings) } } else { - // if no reference is found, reference links are just rendered as normal text. - append(node.getUnescapedTextInNode(content)) + // if no reference is found, reference links are rendered as their individual components + val linkText = node.findChildOfType(MarkdownElementTypes.LINK_TEXT) + if (linkText != null) { + buildMarkdownAnnotatedString(content, linkText, annotatorSettings) + } + buildMarkdownAnnotatedString(content, labelNode, annotatorSettings) } } diff --git a/sample/android/build.gradle.kts b/sample/android/build.gradle.kts index b5249ba1..e7d9c698 100644 --- a/sample/android/build.gradle.kts +++ b/sample/android/build.gradle.kts @@ -1,10 +1,8 @@ plugins { id("com.mikepenz.convention.android-application") - id("com.mikepenz.convention.kotlin") id("com.mikepenz.convention.compose") id("com.mikepenz.aboutlibraries.plugin") id("com.mikepenz.aboutlibraries.plugin.android") - alias(baseLibs.plugins.screenshot) } android { @@ -14,20 +12,16 @@ android { applicationId = "com.mikepenz.markdown" base.archivesName = "markdown-renderer-sample-v$versionName-c$versionCode" } - - @Suppress("UnstableApiUsage") - experimentalProperties["android.experimental.enableScreenshotTest"] = true } dependencies { implementation(project(":sample:shared")) - implementation(compose.foundation) - implementation(compose.material) - implementation(compose.material3) + implementation(baseLibs.jetbrains.compose.foundation) + implementation(baseLibs.jetbrains.compose.material) + implementation(baseLibs.jetbrains.compose.material3) implementation(libs.androidx.activity.compose) implementation(libs.ktor.client.okhttp) - debugImplementation(compose.uiTooling) - "screenshotTestImplementation"(compose.uiTooling) + debugImplementation(baseLibs.jetbrains.compose.ui.tooling) } aboutLibraries { diff --git a/sample/desktop/build.gradle.kts b/sample/desktop/build.gradle.kts index ac416fe1..4cdc8baf 100644 --- a/sample/desktop/build.gradle.kts +++ b/sample/desktop/build.gradle.kts @@ -4,13 +4,14 @@ plugins { id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.aboutlibraries.plugin") + alias(baseLibs.plugins.composeHotreload) } kotlin { sourceSets { commonMain.dependencies { implementation(project(":sample:shared")) - implementation(compose.components.resources) + implementation(baseLibs.jetbrains.compose.components.resources) } jvmMain.dependencies { implementation(compose.desktop.currentOs) diff --git a/sample/desktop/gradle.properties b/sample/desktop/gradle.properties index 4ddebddc..44cbe8fd 100644 --- a/sample/desktop/gradle.properties +++ b/sample/desktop/gradle.properties @@ -1,3 +1,4 @@ com.mikepenz.binary-compatibility-validator.enabled=false com.mikepenz.hotreload.enabled=true -com.mikepenz.java.version=21 \ No newline at end of file +com.mikepenz.java.version=21 +com.mikepenz.android.enabled=false \ No newline at end of file diff --git a/sample/shared/build.gradle.kts b/sample/shared/build.gradle.kts index 860cc378..4716bd1a 100644 --- a/sample/shared/build.gradle.kts +++ b/sample/shared/build.gradle.kts @@ -1,12 +1,14 @@ plugins { - id("com.mikepenz.convention.android-library") id("com.mikepenz.convention.kotlin-multiplatform") id("com.mikepenz.convention.compose") id("com.mikepenz.aboutlibraries.plugin") } kotlin { - androidTarget() + androidLibrary { + namespace = "com.mikepenz.markdown.sample.shared" + experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true + } listOf( iosX64(), @@ -27,12 +29,12 @@ kotlin { api(projects.multiplatformMarkdownRendererCoil3) api(projects.multiplatformMarkdownRendererCode) - implementation(compose.foundation) - implementation(compose.ui) - implementation(compose.uiUtil) - implementation(compose.components.resources) - implementation(compose.material) - implementation(compose.material3) + implementation(baseLibs.jetbrains.compose.foundation) + implementation(baseLibs.jetbrains.compose.ui) + implementation(baseLibs.jetbrains.compose.ui.util) + implementation(baseLibs.jetbrains.compose.components.resources) + implementation(baseLibs.jetbrains.compose.material) + implementation(baseLibs.jetbrains.compose.material3) // required for coil implementation(libs.ktor.client.core) @@ -49,10 +51,6 @@ kotlin { } } -android { - namespace = "com.mikepenz.markdown.sample.shared" -} - compose.resources { packageOfResClass = "com.mikepenz.markdown.sample.shared.resources" } diff --git a/sample/web/build.gradle.kts b/sample/web/build.gradle.kts index a76d9a13..f13b69ef 100644 --- a/sample/web/build.gradle.kts +++ b/sample/web/build.gradle.kts @@ -21,8 +21,8 @@ kotlin { sourceSets { commonMain.dependencies { implementation(project(":sample:shared")) - implementation(compose.foundation) - implementation(compose.components.resources) + implementation(baseLibs.jetbrains.compose.foundation) + implementation(baseLibs.jetbrains.compose.components.resources) } } } @@ -32,9 +32,6 @@ compose.resources { } aboutLibraries { - android { - registerAndroidTasks = false - } export { exportVariant = "wasmJs" outputPath = file("src/commonMain/composeResources/files/aboutlibraries.json") diff --git a/settings.gradle.kts b/settings.gradle.kts index 0def08ea..5e8a4211 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,7 @@ dependencyResolutionManagement { versionCatalogs { create("baseLibs") { - from("com.mikepenz:version-catalog:0.10.1") + from("com.mikepenz:version-catalog:0.12.0") } } }