aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2019-11-05 17:59:11 +0100
committerPaweł Marks <pmarks@virtuslab.com>2019-11-05 17:59:11 +0100
commitab02673643d2a127152e295c78792f6821ee5960 (patch)
tree0697e454af3b76beec5a50a6200f3c6de667c821 /core
parent150b60fb2d5efcbe72b74b084c0c9987b902363f (diff)
downloaddokka-ab02673643d2a127152e295c78792f6821ee5960.tar.gz
dokka-ab02673643d2a127152e295c78792f6821ee5960.tar.bz2
dokka-ab02673643d2a127152e295c78792f6821ee5960.zip
Escaping for html
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/renderers/HtmlRenderer.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/main/kotlin/renderers/HtmlRenderer.kt b/core/src/main/kotlin/renderers/HtmlRenderer.kt
index b6d56fdc..9b76f719 100644
--- a/core/src/main/kotlin/renderers/HtmlRenderer.kt
+++ b/core/src/main/kotlin/renderers/HtmlRenderer.kt
@@ -1,5 +1,6 @@
package org.jetbrains.dokka.renderers
+import org.jetbrains.dokka.htmlEscape
import org.jetbrains.dokka.pages.ContentLink
import org.jetbrains.dokka.pages.ContentNode
import org.jetbrains.dokka.pages.PageNode
@@ -15,10 +16,12 @@ open class HtmlRenderer(fileWriter: FileWriter, locationProvider: LocationProvid
override fun buildNewLine(): String = "<br/>"
- override fun buildLink(text: String, address: String): String = "<a href=\"$address\">$text</a>"
+ override fun buildLink(text: String, address: String): String = "<a href=\"$address\">${text.htmlEscape()}</a>"
override fun buildCode(code: String): String = "<code>$code</code>"
+ override fun buildText(text: String) = super.buildText(text).htmlEscape()
+
override fun buildNavigation(): String = "" // TODO implement
override fun buildGroup(children: List<ContentNode>, pageContext: PageNode): String =