diff --git a/markdown/README.md b/markdown/README.md index 8d3161bebf..80929ded7c 100644 --- a/markdown/README.md +++ b/markdown/README.md @@ -12,6 +12,8 @@ Additional supported Markdown, via extensions: * Alerts ([GitHub Flavored Markdown][alerts-specs]) — see [`extension-gfm-alerts`](extension-gfm-alerts) +Im**agetime, and no guarantees are made for binary and source compatibility. It might also have bugs and missing features. ![here is an image](https://hellorse.fr/images/p/media/image/products/product_76409_2b3beddbf246765581c5e91a9fd6.webp?p=product_thumbnail&type=product) And ot**her stuff time, and no guarantees are made for binary and source compatibility. It might also have bugs and missing features. time, and no guarantees are made for binary and source compatibility. It might also have bugs and missing features. + [alerts-specs]: https://github.com/orgs/community/discussions/16925 On the roadmap, but not currently supported — in no particular order: diff --git a/markdown/core/build.gradle.kts b/markdown/core/build.gradle.kts index 8b5c61f1c5..8a87ebf247 100644 --- a/markdown/core/build.gradle.kts +++ b/markdown/core/build.gradle.kts @@ -8,6 +8,10 @@ plugins { dependencies { compileOnly(projects.ui) api(libs.commonmark.core) + implementation("io.coil-kt.coil3:coil-compose:3.0.0-alpha06") +// Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core' +// https://github.com/coil-kt/coil/issues/842#issuecomment-1975115060 + runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.1-Beta") testImplementation(compose.desktop.uiTestJUnit4) testImplementation(projects.ui) diff --git a/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt b/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt index 5090de9c28..6c54ebea9f 100644 --- a/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt +++ b/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt @@ -95,10 +95,17 @@ public class MarkdownProcessor(private val extensions: List toMarkdownBlockQuote() is Heading -> toMarkdownHeadingOrNull() - is Paragraph -> toMarkdownParagraphOrNull() + is Paragraph -> { + val child = firstChild + if (child is Image && child === lastChild) { + // only render standalone images as blocks + child.toMarkdownImageOrNull() + } else { + toMarkdownParagraphOrNull() + } + } is FencedCodeBlock -> toMarkdownCodeBlockOrNull() is IndentedCodeBlock -> toMarkdownCodeBlockOrNull() - is Image -> toMarkdownImageOrNull() is BulletList -> toMarkdownListOrNull() is OrderedList -> toMarkdownListOrNull() is ThematicBreak -> MarkdownBlock.ThematicBreak @@ -144,7 +151,7 @@ public class MarkdownProcessor(private val extensions: List +![Some IMG](https://hellorse.fr/images/p/media/image/products/product_76409_2b3beddbf246765581c5e91a9fd6.webp?p=product_thumbnail&type=product) + Jewel aims at recreating the IntelliJ Platform's _New UI_ Swing Look and Feel in Compose for Desktop, providing a desktop-optimized theme and set of components.