Skip to content

Commit c628731

Browse files
authored
Merge pull request #339 from mikepenz/feature/337
Add option to make EOL be a new line (for direct APIs)
2 parents 468768a + 4eec36a commit c628731

File tree

10 files changed

+57
-53
lines changed

10 files changed

+57
-53
lines changed

app-desktop/src/jvmMain/kotlin/main.kt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ import androidx.compose.foundation.layout.padding
44
import androidx.compose.foundation.rememberScrollState
55
import androidx.compose.foundation.text.selection.SelectionContainer
66
import androidx.compose.foundation.verticalScroll
7-
import androidx.compose.material.*
8-
import androidx.compose.runtime.*
7+
import androidx.compose.material.Icon
8+
import androidx.compose.material.IconButton
9+
import androidx.compose.material.MaterialTheme
10+
import androidx.compose.material.Scaffold
11+
import androidx.compose.material.Text
12+
import androidx.compose.material.TopAppBar
13+
import androidx.compose.material.contentColorFor
14+
import androidx.compose.runtime.LaunchedEffect
15+
import androidx.compose.runtime.getValue
16+
import androidx.compose.runtime.mutableStateOf
17+
import androidx.compose.runtime.remember
18+
import androidx.compose.runtime.setValue
919
import androidx.compose.ui.Modifier
1020
import androidx.compose.ui.platform.LocalUriHandler
1121
import androidx.compose.ui.unit.dp
@@ -216,8 +226,8 @@ Title 1
216226
Title 2
217227
------
218228
219-
[https://mikepenz.dev](https://mikepenz.dev)
220-
[https://github.com/mikepenz](https://github.com/mikepenz)
221-
[Mike Penz's Blog](https://blog.mikepenz.dev/)
222-
<https://blog.mikepenz.dev/>
229+
[https://mikepenz.dev](https://mikepenz.dev)
230+
[https://github.com/mikepenz](https://github.com/mikepenz)
231+
[Mike Penz's Blog](https://blog.mikepenz.dev/)
232+
<https://blog.mikepenz.dev/>
223233
"""

app-wasm/src/wasmJsMain/kotlin/Main.kt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import androidx.compose.foundation.Image
21
import androidx.compose.foundation.layout.fillMaxSize
32
import androidx.compose.foundation.layout.padding
43
import androidx.compose.foundation.rememberScrollState
@@ -21,10 +20,6 @@ import androidx.compose.ui.graphics.Color
2120
import androidx.compose.ui.platform.LocalUriHandler
2221
import androidx.compose.ui.unit.dp
2322
import androidx.compose.ui.window.CanvasBasedWindow
24-
import coil3.compose.AsyncImage
25-
import coil3.compose.LocalPlatformContext
26-
import coil3.compose.rememberAsyncImagePainter
27-
import coil3.request.ImageRequest
2823
import com.mikepenz.aboutlibraries.Libs
2924
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
3025
import com.mikepenz.aboutlibraries.ui.compose.m3.LibraryDefaults
@@ -37,7 +32,6 @@ import com.mikepenz.markdown.compose.extendedspans.RoundedCornerSpanPainter
3732
import com.mikepenz.markdown.compose.extendedspans.SquigglyUnderlineSpanPainter
3833
import com.mikepenz.markdown.compose.extendedspans.rememberSquigglyUnderlineAnimator
3934
import com.mikepenz.markdown.m3.Markdown
40-
import com.mikepenz.markdown.model.ImageData
4135
import com.mikepenz.markdown.model.markdownExtendedSpans
4236
import org.jetbrains.compose.resources.ExperimentalResourceApi
4337

@@ -205,8 +199,8 @@ Title 1
205199
Title 2
206200
------
207201
208-
[https://mikepenz.dev](https://mikepenz.dev)
209-
[https://github.com/mikepenz](https://github.com/mikepenz)
210-
[Mike Penz's Blog](https://blog.mikepenz.dev/)
211-
<https://blog.mikepenz.dev/>
202+
[https://mikepenz.dev](https://mikepenz.dev)
203+
[https://github.com/mikepenz](https://github.com/mikepenz)
204+
[Mike Penz's Blog](https://blog.mikepenz.dev/)
205+
<https://blog.mikepenz.dev/>
212206
"""

app/src/main/kotlin/com/mikepenz/markdown/MainActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ Title 1
185185
Title 2
186186
------
187187
188-
[https://mikepenz.dev](https://mikepenz.dev)
189-
[https://github.com/mikepenz](https://github.com/mikepenz)
190-
[Mike Penz's Blog](https://blog.mikepenz.dev/)
191-
<https://blog.mikepenz.dev/>
188+
[https://mikepenz.dev](https://mikepenz.dev)
189+
[https://github.com/mikepenz](https://github.com/mikepenz)
190+
[Mike Penz's Blog](https://blog.mikepenz.dev/)
191+
<https://blog.mikepenz.dev/>
192192
"""

app/src/screenshotTest/kotlin/com/mikepenz/markdown/ui/m2/SnapshotTests.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ Title 1
129129
Title 2
130130
------
131131
132-
[https://mikepenz.dev](https://mikepenz.dev)
133-
[https://github.com/mikepenz](https://github.com/mikepenz)
134-
[Mike Penz's Blog](https://blog.mikepenz.dev/)
135-
<https://blog.mikepenz.dev/>
132+
[https://mikepenz.dev](https://mikepenz.dev)
133+
[https://github.com/mikepenz](https://github.com/mikepenz)
134+
[Mike Penz's Blog](https://blog.mikepenz.dev/)
135+
<https://blog.mikepenz.dev/>
136136
""".trimIndent()
137137

138138

app/src/screenshotTest/kotlin/com/mikepenz/markdown/ui/m3/SnapshotTests.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ Title 1
129129
Title 2
130130
------
131131
132-
[https://mikepenz.dev](https://mikepenz.dev)
133-
[https://github.com/mikepenz](https://github.com/mikepenz)
134-
[Mike Penz's Blog](https://blog.mikepenz.dev/)
135-
<https://blog.mikepenz.dev/>
132+
[https://mikepenz.dev](https://mikepenz.dev)
133+
[https://github.com/mikepenz](https://github.com/mikepenz)
134+
[Mike Penz's Blog](https://blog.mikepenz.dev/)
135+
<https://blog.mikepenz.dev/>
136136
""".trimIndent()
137137

138138

multiplatform-markdown-renderer/api/android/multiplatform-markdown-renderer.api

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ public final class com/mikepenz/markdown/annotator/AnnotatedStringKtxKt {
1313
public abstract interface class com/mikepenz/markdown/annotator/AnnotatorSettings {
1414
public abstract fun getAnnotator ()Lcom/mikepenz/markdown/model/MarkdownAnnotator;
1515
public abstract fun getCodeSpanStyle ()Landroidx/compose/ui/text/SpanStyle;
16+
public abstract fun getEolAsNewLine ()Z
1617
public abstract fun getLinkInteractionListener ()Landroidx/compose/ui/text/LinkInteractionListener;
1718
public abstract fun getLinkTextSpanStyle ()Landroidx/compose/ui/text/TextLinkStyles;
1819
public abstract fun getReferenceLinkHandler ()Lcom/mikepenz/markdown/model/ReferenceLinkHandler;
1920
}
2021

2122
public final class com/mikepenz/markdown/annotator/AnnotatorSettingsKt {
22-
public static final fun annotatorSettings (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/platform/UriHandler;Landroidx/compose/ui/text/LinkInteractionListener;Landroidx/compose/runtime/Composer;II)Lcom/mikepenz/markdown/annotator/AnnotatorSettings;
23+
public static final fun annotatorSettings (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/platform/UriHandler;Landroidx/compose/ui/text/LinkInteractionListener;ZLandroidx/compose/runtime/Composer;II)Lcom/mikepenz/markdown/annotator/AnnotatorSettings;
2324
}
2425

2526
public final class com/mikepenz/markdown/annotator/DefaultAnnotatorSettings : com/mikepenz/markdown/annotator/AnnotatorSettings {
2627
public static final field $stable I
27-
public fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;)V
28-
public synthetic fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
29-
public fun <init> (Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;)V
30-
public synthetic fun <init> (Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
28+
public fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;Z)V
29+
public synthetic fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
3130
public fun getAnnotator ()Lcom/mikepenz/markdown/model/MarkdownAnnotator;
3231
public fun getCodeSpanStyle ()Landroidx/compose/ui/text/SpanStyle;
32+
public fun getEolAsNewLine ()Z
3333
public fun getLinkInteractionListener ()Landroidx/compose/ui/text/LinkInteractionListener;
3434
public fun getLinkTextSpanStyle ()Landroidx/compose/ui/text/TextLinkStyles;
3535
public fun getReferenceLinkHandler ()Lcom/mikepenz/markdown/model/ReferenceLinkHandler;

multiplatform-markdown-renderer/api/jvm/multiplatform-markdown-renderer.api

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ public final class com/mikepenz/markdown/annotator/AnnotatedStringKtxKt {
1313
public abstract interface class com/mikepenz/markdown/annotator/AnnotatorSettings {
1414
public abstract fun getAnnotator ()Lcom/mikepenz/markdown/model/MarkdownAnnotator;
1515
public abstract fun getCodeSpanStyle ()Landroidx/compose/ui/text/SpanStyle;
16+
public abstract fun getEolAsNewLine ()Z
1617
public abstract fun getLinkInteractionListener ()Landroidx/compose/ui/text/LinkInteractionListener;
1718
public abstract fun getLinkTextSpanStyle ()Landroidx/compose/ui/text/TextLinkStyles;
1819
public abstract fun getReferenceLinkHandler ()Lcom/mikepenz/markdown/model/ReferenceLinkHandler;
1920
}
2021

2122
public final class com/mikepenz/markdown/annotator/AnnotatorSettingsKt {
22-
public static final fun annotatorSettings (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/platform/UriHandler;Landroidx/compose/ui/text/LinkInteractionListener;Landroidx/compose/runtime/Composer;II)Lcom/mikepenz/markdown/annotator/AnnotatorSettings;
23+
public static final fun annotatorSettings (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/platform/UriHandler;Landroidx/compose/ui/text/LinkInteractionListener;ZLandroidx/compose/runtime/Composer;II)Lcom/mikepenz/markdown/annotator/AnnotatorSettings;
2324
}
2425

2526
public final class com/mikepenz/markdown/annotator/DefaultAnnotatorSettings : com/mikepenz/markdown/annotator/AnnotatorSettings {
2627
public static final field $stable I
27-
public fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;)V
28-
public synthetic fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
29-
public fun <init> (Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;)V
30-
public synthetic fun <init> (Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
28+
public fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;Z)V
29+
public synthetic fun <init> (Landroidx/compose/ui/text/TextLinkStyles;Landroidx/compose/ui/text/SpanStyle;Lcom/mikepenz/markdown/model/MarkdownAnnotator;Lcom/mikepenz/markdown/model/ReferenceLinkHandler;Landroidx/compose/ui/text/LinkInteractionListener;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
3130
public fun getAnnotator ()Lcom/mikepenz/markdown/model/MarkdownAnnotator;
3231
public fun getCodeSpanStyle ()Landroidx/compose/ui/text/SpanStyle;
32+
public fun getEolAsNewLine ()Z
3333
public fun getLinkInteractionListener ()Landroidx/compose/ui/text/LinkInteractionListener;
3434
public fun getLinkTextSpanStyle ()Landroidx/compose/ui/text/TextLinkStyles;
3535
public fun getReferenceLinkHandler ()Lcom/mikepenz/markdown/model/ReferenceLinkHandler;

0 commit comments

Comments
 (0)