From a2be91ea289ddb1a8634c5fd252243f1b9ab7000 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 17 Aug 2020 10:46:26 +0200 Subject: Implement SelfRepresentingSingletonSet and let `ContentSourceSet` conform to it --- plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 6 +++--- plugins/gfm/src/main/kotlin/GfmPlugin.kt | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index d776e602..529caa93 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -220,7 +220,7 @@ open class HtmlRenderer( return nodes.toList().map { (sourceSet, elements) -> sourceSet to createHTML(prettyPrint = false).div { elements.forEach { - buildContentNode(it, pageContext, setOf(sourceSet)) + buildContentNode(it, pageContext, sourceSet.toSet()) } }.stripDiv() }.groupBy( @@ -248,13 +248,13 @@ open class HtmlRenderer( node.groupDivergentInstances(pageContext, { instance, contentPage, sourceSet -> createHTML(prettyPrint = false).div { instance.before?.let { before -> - buildContentNode(before, pageContext, setOf(sourceSet)) + buildContentNode(before, pageContext, sourceSet) } }.stripDiv() }, { instance, contentPage, sourceSet -> createHTML(prettyPrint = false).div { instance.after?.let { after -> - buildContentNode(after, pageContext, setOf(sourceSet)) + buildContentNode(after, pageContext, sourceSet) } }.stripDiv() }) diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt index d93b4e98..8ae4a78a 100644 --- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt +++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt @@ -246,11 +246,11 @@ open class CommonmarkRenderer( val distinct = node.groupDivergentInstances(pageContext, { instance, contentPage, sourceSet -> instance.before?.let { before -> - buildString { buildContentNode(before, pageContext, setOf(sourceSet)) } + buildString { buildContentNode(before, pageContext, sourceSet) } } ?: "" }, { instance, contentPage, sourceSet -> instance.after?.let { after -> - buildString { buildContentNode(after, pageContext, setOf(sourceSet)) } + buildString { buildContentNode(after, pageContext, sourceSet) } } ?: "" }) @@ -265,7 +265,7 @@ open class CommonmarkRenderer( buildContentNode( it, pageContext, - setOf(sourceSets.first()) + sourceSets.first() ) // It's workaround to render content only once buildNewLine() } @@ -293,7 +293,7 @@ open class CommonmarkRenderer( buildContentNode( it, pageContext, - setOf(sourceSets.first()) + sourceSets.first() ) // It's workaround to render content only once buildNewLine() } -- cgit