All Downloads are FREE. Search and download functionalities are using the official Maven repository.

utilities.Html.kt Maven / Gradle / Ivy

Go to download

Dokka is an API documentation engine for Kotlin and Java, performing the same function as Javadoc for Java

There is a newer version: 2.0.0
Show newest version
package org.jetbrains.dokka.utilities

import java.net.URLEncoder


/**
 * Replaces symbols reserved in HTML with their respective entities.
 * Replaces & with &, < with < and > with >
 */
fun String.htmlEscape(): String = replace("&", "&").replace("<", "<").replace(">", ">")

fun String.urlEncoded(): String = URLEncoder.encode(this, "UTF-8")

fun String.formatToEndWithHtml() =
    if (endsWith(".html") || contains(Regex("\\.html#"))) this else "$this.html"




© 2015 - 2025 Weber Informatics LLC | Privacy Policy