@@ -125,7 +125,7 @@ fun sanitizeWhitespace(text: String): String{
125
125
126
126
// If we don't detect any newlines we assume unformatted input and leave any excess whitespace in
127
127
if ( ! text.contains(" \n " )){
128
- return text;
128
+ return text
129
129
}
130
130
else {
131
131
// if we detect newlines, we strip out the unnecessary whitespace from the inputs
@@ -141,12 +141,10 @@ fun sanitizeWhitespace(text: String): String{
141
141
142
142
var sanitized = text
143
143
144
- // meant to keep " text" as is but change "\n text" into "text"
145
144
if (startsWithReturn){
146
145
sanitized = sanitized.trimStart(' \n ' , ' ' )
147
146
}
148
147
149
- // meant to keep "text " as is but change "text\n " into "text"
150
148
if (endsWithReturnAndMaybeSpace){
151
149
sanitized = sanitized.trimEnd(' \n ' , ' ' )
152
150
}
@@ -160,7 +158,6 @@ fun sanitizeWhitespace(text: String): String{
160
158
// pre or pre-wrap set. (Or in XHTML, the xml:space="preserve" attribute.)
161
159
sanitized = sanitized.replace(" \\ s+" .toRegex(), " " )
162
160
163
-
164
161
return sanitized
165
162
166
163
}
@@ -171,10 +168,6 @@ fun printRawHtmlReturnsAndIndents() : Boolean {
171
168
return true
172
169
}
173
170
174
- fun maxCharactersBeforeSwitchingToMultiline (): Int {
175
- return 150
176
- }
177
-
178
171
fun outputTag (tag : Tag , indentationLevel : Int , tab : String ) : String {
179
172
var output = " "
180
173
if (" comment" == tag.name) {
@@ -396,16 +389,8 @@ private fun outputStringValue(singleTextValue: Boolean, tab: String, indentation
396
389
if (! singleTextValue || inWithBlock) {
397
390
output + = " text("
398
391
}
399
- if (false && childString.contains(" \n " ) || childString.length >= maxCharactersBeforeSwitchingToMultiline()) {
400
- // triple quotes if long or several lines
401
- output + = " \n "
402
- output + = tab.repeat(indentationLevel) + " \"\"\"\n "
403
- output + = tab.repeat(indentationLevel)
404
- output + = " ${escapeSoThatJavaPrintsItLikeItIsInTheInput(childString)} \n "
405
- output + = tab.repeat(indentationLevel) + " \"\"\" "
406
- } else {
407
- output + = " \" ${escapeSoThatJavaPrintsItLikeItIsInTheInput(childString)} \" "
408
- }
392
+ output + = " \" ${escapeSoThatJavaPrintsItLikeItIsInTheInput(childString)} \" "
393
+
409
394
// closing the text()
410
395
if (! singleTextValue || inWithBlock) {
411
396
output + = " )"
0 commit comments