From 8a221a9084bf4fbc79b514c7f113fa2c4cb3dcfd Mon Sep 17 00:00:00 2001 From: Filip ZybaƂa Date: Tue, 23 Jun 2020 13:52:20 +0200 Subject: Platform restriction handling for platform-hinted content --- plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt') diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 8104d399..43722888 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -135,9 +135,15 @@ open class HtmlRenderer( } } - override fun FlowContent.buildPlatformDependent(content: PlatformHintedContent, pageContext: ContentPage) = + override fun FlowContent.buildPlatformDependent( + content: PlatformHintedContent, + pageContext: ContentPage, + sourceSetRestriction: Set? + ) = buildPlatformDependent( - content.sourceSets.map { it to setOf(content.inner) }.toMap(), + content.sourceSets.filter { + sourceSetRestriction == null || it in sourceSetRestriction + }.map { it to setOf(content.inner) }.toMap(), pageContext, content.extra, content.style -- cgit