utilities.Html.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dokka-core Show documentation
Show all versions of dokka-core Show documentation
Dokka is an API documentation engine for Kotlin and Java, performing the same function as Javadoc for Java
package org.jetbrains.dokka.utilities
import org.jetbrains.dokka.InternalDokkaApi
import java.net.URLEncoder
/**
* Replaces symbols reserved in HTML with their respective entities.
* Replaces & with &, < with < and > with >
*/
@InternalDokkaApi
fun String.htmlEscape(): String = replace("&", "&").replace("<", "<").replace(">", ">").replace("\"", """)
@InternalDokkaApi
fun String.urlEncoded(): String = URLEncoder.encode(this, "UTF-8")
@InternalDokkaApi
fun String.formatToEndWithHtml() =
if (endsWith(".html") || contains(Regex("\\.html#"))) this else "$this.html"
© 2015 - 2025 Weber Informatics LLC | Privacy Policy