Has anyone run across this issue yet? ```> Tas...
# kobweb
r
Has anyone run across this issue yet?
Copy code
> Task :site:kobwebxMarkdownConvert FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':site:kobwebxMarkdownConvert'.
> class org.commonmark.node.Emphasis cannot be cast to class org.commonmark.node.Text (org.commonmark.node.Emphasis and org.commonmark.node.Text are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @6c75677b)
For clarity, this happened to me after I upgraded from v0.19.0 to v0.20.0
d
Can you identify the markdown in your site that is breaking?
r
It's probably something like this:
_something_
Yep.
That's it.
d
Just at the top level? Or like inside a link or anything?
r
Top level.
Inside a link or a code block or something, that wouldn't get treated as special.
d
Wild, can't believe I never triggered that
r
I'm looking for other occurrences.
d
Thanks
r
There are a few other occurrences.
I will temporarily remove them and try again to isolate the issue.
d
Thanks
r
okay--that wasn't the root cause.
Still getting the same error, though, when attempting to process markdown. Some files seem to succeed, but some files do not.
Downgrading to 0.19.3 does not result in this issue.
From the release notes, I see that the version of commonmark was upgraded.
d
I just tested locally:
Copy code
Markdown test: *bold*, _italic_, and **bold italic** text.
and it worked fine.
The last time we updated commonmark dependencies in Kobweb was November 2023
r
Yah--I don't think that is the root cause.
I'm wondering whether this has to do with the project layout.
I dunno. Everything was working fine for me on 0.19.0.
I actually just verified that this error occurs on 0.19.1.
And it doesn't have to do with the layout.
d
Are you doing anything custom in your
build.gradle.kts
file with markdown handlers?
r
Yes.
Copy code
handlers {
            val packageName = "com.fsryan.site.components"

            code.set { code ->
                "$packageName.code.CodeBlock(text = \"\"\"${code.literal.escapeTripleQuotedText()}\"\"\", lang = ${
                    code.info.takeIf { it.isNotBlank() }?.let { "\"$it\"" }
                })"
            }
        }
I lifted that from your site.
d
You can try commenting it out just in case but it probably isn't that
r
Just to check on the versions:
Copy code
jetbrains-compose = "1.7.1"
kobweb = "0.20.0"
kotlin = "2.1.0"
Yah--commenting out that section didn't help.
d
Just an update in case anyone is lurking -- this was a crash due to markdown text like this:
Copy code
> *Note*
> Here is a note
In 0.19.1, we introduced a new callout syntax which looks like this:
Copy code
> [!NOTE]
> Here is a note
I would NOT have expected that to crash the kind of text Ryan was using, but it does look like I have some bad logic in there. I'll fix it for 0.20.1, although hopefully the average person won't get hit with this.
r
Yep--just abnormal people like me.
🤝 1
🙂
d
0.20.1-SNAPSHOT
should have the fix!