Closed EgorBron closed 5 months ago
I also looked to Kobweb Gradle plugin, and, under the hood, it uses img.convention { }
and img.children()
. I tried this too, but nothing changed (except the img.children()
, which is sometimes became null
).
I'm trying to style images in Markdown files.
I know, a bit better way to do this is to write some CSS or define
@InitSilk
and set the selector. But, I decided to write a markdown handler for all images, as I found something similar (but for code blocks) in bitspittle's blog source.For some reason it produces really weird code.
Let's say I have an empty Kobweb app with package name
net.website
.I put an image to
resources/public
and created a Markdown fileHelloWorld.md
with such content:For all Markdown images I created a component:
Then, in
site/build.gradle.kts
I added the handler:Finally, I ran
kobweb run
, but it throws an error:Now, I look to the generated
HelloWorld.kt
:The image title (or alt text) was moved to composable trailing lambda as
Text
composable, while title becamenull
!The expected output is the same code as in 6., but without trailing labmda after
MdImage
andnull
inimg.title
.