Complete the Subpage.open() method

This commit is contained in:
Username404 2021-06-20 21:54:51 +02:00
parent b72440dc82
commit 70a356208d
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 4 additions and 1 deletions

View File

@ -12,5 +12,8 @@ data class Subpage(
val meta: Set<HTMLMetaElement>?,
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 }
)
}