From 70a356208d1279f7ae33e720508c7667c6420442 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sun, 20 Jun 2021 21:54:51 +0200 Subject: [PATCH] Complete the Subpage.open() method --- src/main/kotlin/fr/username404/website/subpages/Subpage.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/fr/username404/website/subpages/Subpage.kt b/src/main/kotlin/fr/username404/website/subpages/Subpage.kt index 60d9126..2f31185 100644 --- a/src/main/kotlin/fr/username404/website/subpages/Subpage.kt +++ b/src/main/kotlin/fr/username404/website/subpages/Subpage.kt @@ -12,5 +12,8 @@ data class Subpage( val meta: Set?, val content: HTMLElement ) { - fun open(): Document = window.document.open(type = "text/html", replace = content.innerHTML) + fun open(): Document = window.document.open( + type = "text/html", + replace = head.map { it.innerHTML }.reduce { previous, current -> previous + "\n" + current } + ) }