From fc38ceda06d92978175d37bb7197763539c966a2 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Thu, 23 Jul 2020 12:38:59 +0200 Subject: Make unresolved links render as text --- plugins/gfm/src/main/kotlin/GfmPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/gfm/src') diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt index b565deb5..3cec8320 100644 --- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt +++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt @@ -318,12 +318,12 @@ open class CommonmarkRenderer( get() = this !is RendererSpecificPage || strategy != RenderingStrategy.DoNothing private fun StringBuilder.buildLink(to: PageNode, from: PageNode) = - buildLink(locationProvider.resolve(to, from)) { + buildLink(locationProvider.resolve(to, from)!!) { append(to.name) } override suspend fun renderPage(page: PageNode) { - val path by lazy { locationProvider.resolve(page, skipExtension = true) } + val path by lazy { locationProvider.resolve(page, skipExtension = true)!! } when (page) { is ContentPage -> outputWriter.write(path, buildPage(page) { c, p -> buildPageContent(c, p) }, ".md") is RendererSpecificPage -> when (val strategy = page.strategy) { -- cgit