Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2021 Mike Penz
Copyright 2022 Mike Penz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ Big thanks to [Erik Hellman](https://twitter.com/ErikHellman) and his awesome ar

## Fork License

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.
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.

## License

Copyright 2021 Mike Penz
Copyright 2022 Mike Penz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
kotlinCompilerExtensionVersion = Versions.composeCompiler
}

buildTypes {
Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle:7.0.3")
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.18.0")
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.6.0")
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:10.0.0-b02")
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.6.10")
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:10.0.0-b07")
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.1-rc2")
}
}

Expand Down
7 changes: 4 additions & 3 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ object Versions {
const val androidCompileSdk = 31
const val androidTargetSdk = androidCompileSdk

const val kotlin = "1.5.31"
const val kotlin = "1.6.10"

const val markdown = "0.2.4"

const val coil = "1.4.0"
const val compose = "1.1.0-beta03"
const val compose = "1.1.0-rc01"
const val composeCompiler = "1.1.0-rc02"

const val material = "1.5.0-beta01"
const val material = "1.5.0"
const val activityCompose = "1.4.0"
const val lifecycleKtx = "2.3.1"
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maven stuff
GROUP=com.mikepenz
VERSION_NAME=0.3.0
VERSION_CODE=300
VERSION_NAME=0.4.0
VERSION_CODE=400

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

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright ? 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?,
# ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?;
# * compound commands having a testable exit status, especially ?case?;
# * various built-in commands including ?command?, ?set?, and ?ulimit?.
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.dp

Expand All @@ -24,7 +23,7 @@ import androidx.compose.ui.unit.dp
fun Code(
code: String,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified
colors: MarkdownColors,
) {
val scroll = rememberScrollState(0)

Expand All @@ -40,7 +39,7 @@ fun Code(
modifier = Modifier
.horizontalScroll(scroll)
.padding(8.dp),
style = MaterialTheme.typography.body2.copy(fontFamily = FontFamily.Monospace, color = color)
style = MaterialTheme.typography.body2.copy(fontFamily = FontFamily.Monospace, color = colors.textColor)
)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.mikepenz.markdown

import org.intellij.markdown.IElementType
import org.intellij.markdown.MarkdownElementTypes
import org.intellij.markdown.MarkdownTokenTypes
import org.intellij.markdown.ast.ASTNode

/**
Expand Down Expand Up @@ -34,4 +36,11 @@ fun ASTNode.findChildOfTypeRecursive(type: IElementType): ASTNode? {
* Helper function to drop the first and last element in the children list.
* E.g. we don't want to render the brackets of a link
*/
internal fun List<ASTNode>.innerList(): List<ASTNode> = this.subList(1, this.size - 1)
internal fun List<ASTNode>.innerList(): List<ASTNode> = this.subList(1, this.size - 1)

/**
* Helper function to filter out items within a list of nodes, not of interest for the bullet list.
*/
internal fun List<ASTNode>.filterNonListTypes(): List<ASTNode> = this.filter { n ->
n.type != MarkdownElementTypes.ORDERED_LIST && n.type != MarkdownElementTypes.UNORDERED_LIST && n.type != MarkdownTokenTypes.EOL
}
Loading