aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Utilities/Html.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/Utilities/Html.kt')
-rw-r--r--core/src/main/kotlin/Utilities/Html.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Utilities/Html.kt b/core/src/main/kotlin/Utilities/Html.kt
index a5a93d9e..de1ce1a5 100644
--- a/core/src/main/kotlin/Utilities/Html.kt
+++ b/core/src/main/kotlin/Utilities/Html.kt
@@ -1,8 +1,12 @@
package org.jetbrains.dokka
+import java.net.URLEncoder
+
/**
* Replaces symbols reserved in HTML with their respective entities.
* Replaces & with &amp;, < with &lt; and > with &gt;
*/
fun String.htmlEscape(): String = replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
+
+fun String.urlEncoded(): String = URLEncoder.encode(this, "UTF-8") \ No newline at end of file