Skip to content

Commit f221cab

Browse files
authored
Merge pull request #32 from mikepenz/develop
dev -> main
2 parents 718f355 + 0c60edf commit f221cab

File tree

13 files changed

+185
-68
lines changed

13 files changed

+185
-68
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2021 Mike Penz
189+
Copyright 2022 Mike Penz
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ Big thanks to [Erik Hellman](https://twitter.com/ErikHellman) and his awesome ar
112112

113113
## Fork License
114114

115-
Copyright for portions of the code are held by [Erik Hellman, 2020] as part of project [MarkdownComposer](https://github.com/ErikHellman/MarkdownComposer) under the MIT license. All other copyright for project multiplatform-markdown-renderer are held by [Mike Penz, 2021] under the Apache License, Version 2.0.
115+
Copyright for portions of the code are held by [Erik Hellman, 2020] as part of project [MarkdownComposer](https://github.com/ErikHellman/MarkdownComposer) under the MIT license. All other copyright for project multiplatform-markdown-renderer are held by [Mike Penz, 2022] under the Apache License, Version 2.0.
116116

117117
## License
118118

119-
Copyright 2021 Mike Penz
119+
Copyright 2022 Mike Penz
120120

121121
Licensed under the Apache License, Version 2.0 (the "License");
122122
you may not use this file except in compliance with the License.

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
}
3030

3131
composeOptions {
32-
kotlinCompilerExtensionVersion = Versions.compose
32+
kotlinCompilerExtensionVersion = Versions.composeCompiler
3333
}
3434

3535
buildTypes {

build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath("com.android.tools.build:gradle:7.0.3")
12+
classpath("com.android.tools.build:gradle:7.0.4")
1313
classpath("com.vanniktech:gradle-maven-publish-plugin:0.18.0")
1414
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0")
15-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
16-
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.6.0")
17-
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:10.0.0-b02")
18-
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
15+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
16+
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.6.10")
17+
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:10.0.0-b07")
18+
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.1-rc2")
1919
}
2020
}
2121

buildSrc/src/main/java/Dependencies.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ object Versions {
33
const val androidCompileSdk = 31
44
const val androidTargetSdk = androidCompileSdk
55

6-
const val kotlin = "1.5.31"
6+
const val kotlin = "1.6.10"
77

88
const val markdown = "0.2.4"
99

1010
const val coil = "1.4.0"
11-
const val compose = "1.1.0-beta03"
11+
const val compose = "1.1.0-rc01"
12+
const val composeCompiler = "1.1.0-rc02"
1213

13-
const val material = "1.5.0-beta01"
14+
const val material = "1.5.0"
1415
const val activityCompose = "1.4.0"
1516
const val lifecycleKtx = "2.3.1"
1617
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maven stuff
22
GROUP=com.mikepenz
3-
VERSION_NAME=0.3.0
4-
VERSION_CODE=300
3+
VERSION_NAME=0.4.0
4+
VERSION_CODE=400
55

66
POM_URL=https://github.com/mikepenz/multiplatform-markdown-renderer
77

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright ? 2015-2021 the original authors.
4+
# Copyright © 2015-2021 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
3232
# Busybox and similar reduced shells will NOT work, because this script
3333
# requires all of these POSIX shell features:
3434
# * functions;
35-
# * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?,
36-
# ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?;
37-
# * compound commands having a testable exit status, especially ?case?;
38-
# * various built-in commands including ?command?, ?set?, and ?ulimit?.
35+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37+
# * compound commands having a testable exit status, especially «case»;
38+
# * various built-in commands including «command», «set», and «ulimit».
3939
#
4040
# Important for patching:
4141
#

multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/Code.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import androidx.compose.material.Surface
1010
import androidx.compose.material.Text
1111
import androidx.compose.runtime.Composable
1212
import androidx.compose.ui.Modifier
13-
import androidx.compose.ui.graphics.Color
1413
import androidx.compose.ui.text.font.FontFamily
1514
import androidx.compose.ui.unit.dp
1615

@@ -24,7 +23,7 @@ import androidx.compose.ui.unit.dp
2423
fun Code(
2524
code: String,
2625
modifier: Modifier = Modifier,
27-
color: Color = Color.Unspecified
26+
colors: MarkdownColors,
2827
) {
2928
val scroll = rememberScrollState(0)
3029

@@ -40,7 +39,7 @@ fun Code(
4039
modifier = Modifier
4140
.horizontalScroll(scroll)
4241
.padding(8.dp),
43-
style = MaterialTheme.typography.body2.copy(fontFamily = FontFamily.Monospace, color = color)
42+
style = MaterialTheme.typography.body2.copy(fontFamily = FontFamily.Monospace, color = colors.textColor)
4443
)
4544
}
4645
}

multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/Extensions.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.mikepenz.markdown
22

33
import org.intellij.markdown.IElementType
4+
import org.intellij.markdown.MarkdownElementTypes
5+
import org.intellij.markdown.MarkdownTokenTypes
46
import org.intellij.markdown.ast.ASTNode
57

68
/**
@@ -34,4 +36,11 @@ fun ASTNode.findChildOfTypeRecursive(type: IElementType): ASTNode? {
3436
* Helper function to drop the first and last element in the children list.
3537
* E.g. we don't want to render the brackets of a link
3638
*/
37-
internal fun List<ASTNode>.innerList(): List<ASTNode> = this.subList(1, this.size - 1)
39+
internal fun List<ASTNode>.innerList(): List<ASTNode> = this.subList(1, this.size - 1)
40+
41+
/**
42+
* Helper function to filter out items within a list of nodes, not of interest for the bullet list.
43+
*/
44+
internal fun List<ASTNode>.filterNonListTypes(): List<ASTNode> = this.filter { n ->
45+
n.type != MarkdownElementTypes.ORDERED_LIST && n.type != MarkdownElementTypes.UNORDERED_LIST && n.type != MarkdownTokenTypes.EOL
46+
}

0 commit comments

Comments
 (0)