From b697931315234ca74767ce26e2e9b03b46e4ad21 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 25 Apr 2017 18:18:19 +0300 Subject: Fix escaping in samples for KWS HTML format --- core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt | 2 +- core/testdata/format/website-html/dropImport.html | 2 +- core/testdata/format/website-html/newLinesInImportList.html | 2 +- core/testdata/format/website-html/newLinesInSamples.html | 2 +- core/testdata/format/website-html/sample.html | 2 +- core/testdata/format/website-html/sampleWithAsserts.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt index 0d8b10bb..378401f3 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt @@ -150,7 +150,7 @@ open class KotlinWebsiteHtmlOutputBuilder(to: StringBuilder, div(to, "sample") { appendBlockCode(language) { imports() - wrap("\n\nfun main(args: Array) {", "}") { + wrap("\n\nfun main(args: Array) {".htmlEscape(), "}") { wrap("\n//sampleStart\n", "\n//sampleEnd\n", body) } } diff --git a/core/testdata/format/website-html/dropImport.html b/core/testdata/format/website-html/dropImport.html index cfcb8cd5..97ff4a68 100644 --- a/core/testdata/format/website-html/dropImport.html +++ b/core/testdata/format/website-html/dropImport.html @@ -4,7 +4,7 @@
fun foo(): Unit
import some.*
 
-fun main(args: Array) {
+fun main(args: Array<String>) {
 //sampleStart
 
 //sampleEnd
diff --git a/core/testdata/format/website-html/newLinesInImportList.html b/core/testdata/format/website-html/newLinesInImportList.html
index 4862b314..334ed11c 100644
--- a/core/testdata/format/website-html/newLinesInImportList.html
+++ b/core/testdata/format/website-html/newLinesInImportList.html
@@ -5,7 +5,7 @@
 
import same.*
 import some.*
 
-fun main(args: Array) {
+fun main(args: Array<String>) {
 //sampleStart
 
 //sampleEnd
diff --git a/core/testdata/format/website-html/newLinesInSamples.html b/core/testdata/format/website-html/newLinesInSamples.html
index 0babe122..ab70140d 100644
--- a/core/testdata/format/website-html/newLinesInSamples.html
+++ b/core/testdata/format/website-html/newLinesInSamples.html
@@ -4,7 +4,7 @@
 
fun foo(): Unit

 
-fun main(args: Array) {
+fun main(args: Array<String>) {
 //sampleStart
 val words = listOf("a", "abc", "ab", "def", "abcd")
 val byLength = words.groupBy { it.length }
diff --git a/core/testdata/format/website-html/sample.html b/core/testdata/format/website-html/sample.html
index 55d321c0..d709edc4 100644
--- a/core/testdata/format/website-html/sample.html
+++ b/core/testdata/format/website-html/sample.html
@@ -6,7 +6,7 @@
 applied to each element and returns a map where each group key is associated with a list of corresponding elements.


 
-fun main(args: Array) {
+fun main(args: Array<String>) {
 //sampleStart
 if (true) {
     println(property)
diff --git a/core/testdata/format/website-html/sampleWithAsserts.html b/core/testdata/format/website-html/sampleWithAsserts.html
index 7d014dbb..e70d37c9 100644
--- a/core/testdata/format/website-html/sampleWithAsserts.html
+++ b/core/testdata/format/website-html/sampleWithAsserts.html
@@ -5,7 +5,7 @@
 
import java.io.FileNotFoundException
 import java.io.File
 
-fun main(args: Array) {
+fun main(args: Array<String>) {
 //sampleStart
 println(a()) // Hello, Work
 println("a() == b() is ${a() == b()}") // true
-- 
cgit