@@ -13,7 +13,7 @@ import java.util.*
13
13
14
14
import org.parboiled.common.Preconditions.checkArgNotNull
15
15
16
- class ToAsciiDocSerializerKt @JvmOverloads constructor(private var rootNode : RootNode , protected var source : String? = null ) : Visitor {
16
+ class ToAsciiDocSerializerKt @JvmOverloads constructor(private var rootNode : RootNode , private var source : String ) : Visitor {
17
17
18
18
protected var printer = Printer ()
19
19
protected val references: MutableMap <String , ReferenceNode > = HashMap ()
@@ -269,7 +269,7 @@ class ToAsciiDocSerializerKt @JvmOverloads constructor(private var rootNode: Roo
269
269
SimpleNode .Type .Linebreak ->
270
270
// look for length of span to detect hard line break (2 trailing spaces plus endline)
271
271
// necessary because Pegdown doesn't distinguish between a hard line break and a normal line break
272
- if (source != null && source !! .substring(node.startIndex, node.endIndex).startsWith(HARD_LINE_BREAK_MARKDOWN )) {
272
+ if (source.substring(node.startIndex, node.endIndex).startsWith(HARD_LINE_BREAK_MARKDOWN )) {
273
273
printer.print (" +" ).println ()
274
274
} else {
275
275
// QUESTION should we fold or preserve soft line breaks? (pandoc emits a space here)
@@ -325,7 +325,9 @@ class ToAsciiDocSerializerKt @JvmOverloads constructor(private var rootNode: Roo
325
325
printer.print (" |" )
326
326
}
327
327
column.accept(this )
328
- if (node.colSpan > 1 ) printer.print (" colspan=\" " ).print (Integer .toString(node.colSpan)).print (' "' )
328
+ if (node.colSpan > 1 ) {
329
+ printer.print (" colspan=\" " ).print (Integer .toString(node.colSpan)).print (' "' )
330
+ }
329
331
visitChildren(node)
330
332
331
333
currentTableColumn + = node.colSpan
@@ -382,7 +384,6 @@ class ToAsciiDocSerializerKt @JvmOverloads constructor(private var rootNode: Roo
382
384
383
385
override fun visit (node : TableRowNode ) {
384
386
currentTableColumn = 0
385
-
386
387
printer.println ()
387
388
388
389
visitChildren(node)
0 commit comments