Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coil3 isnt quite working #327

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Coil3 isnt quite working #327

wants to merge 1 commit into from

Conversation

obask
Copy link
Collaborator

@obask obask commented Mar 22, 2024

No description provided.

@obask obask marked this pull request as draft March 22, 2024 06:42
@@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks wrong

@@ -144,7 +151,7 @@ public class MarkdownProcessor(private val extensions: List<MarkdownProcessorExt
private fun Image.toMarkdownImageOrNull(): MarkdownBlock.Image? {
if (destination.isBlank()) return null

return MarkdownBlock.Image(destination.trim(), title.trim())
return MarkdownBlock.Image(destination.trim(), (title?:"").trim())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return MarkdownBlock.Image(destination.trim(), (title?:"").trim())
return MarkdownBlock.Image(destination.trim(), title.orEmpty().trim())

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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break in the IDE, we can't bring coroutine dependencies in. We need to use those that the platform has.

is Paragraph -> toMarkdownParagraphOrNull()
is Paragraph -> {
val child = firstChild
if (child is Image && child === lastChild) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rock3r Could this be written better? (does "===" operator be error prone?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The === check makes the is check pointless I suppose — but I haven't checked the code too thoroughly yet, since Oleg said it's not really working anyway. I'm not sure why we need a ref equality check here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants