mikepenz/multiplatform-markdown-renderer

Bug report: dividers are never rendered

Closed this issue · 8 comments

About this issue

If I render the following snippet in markdown, I never see horizontal lines rendered

This is a divider

---

The above is a divider

Will render like so

image

Details

  •  Used library version - 0.14.0
  •  Used platform - Desktop
  •  Used support library version
  •  Used gradle build tools version - N/A
  •  Used tooling / Android Studio version - N/A
  •  Other used libraries, potential conflicting libraries - Jewel

Checklist

Thank you for the report. This might be a theming matter.

Screenshot 2024-04-25 at 20 23 13 Screenshot 2024-04-25 at 20 23 36

You can pass a custom color to the dividerColor via the markdownColors()

By default it uses MaterialTheme.colors.onSurface.copy(alpha = 0.12f)

Hmm, I'm not sure. I tested with even using Color.Red hardcoded and had the same issue. You can find a repro here: slackhq/slack-gradle-plugin#825

Note that the linked project isn't using material, but rather an intellij-esque theme built by jetbrains for use in IJ plugins called Jewel

Interestingly, while trying to implement this fix, it suddenly started working when I specified a custom component lambda 🤔.

image image

More interestingly, even though it appears now, I don't seem to be able to change the color even if I hardcode dividerColor to something like Color.Red

I am trying to get the referenced branch compiling. However when running I'd see:

Caused by: java.lang.ClassNotFoundException: androidx.collection.ScatterMapKt

It looks like it's because MarkdownDivider doesn't use dividerColor 😅. That'd explain it

image

🤕 Oh wow. I overlooked that also now going through it 5 times.