diff options
Diffstat (limited to 'src/Formats/StructuredFormatService.kt')
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index b1e614f6..40feaf21 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -32,14 +32,12 @@ public abstract class StructuredFormatService(val locationService: LocationServi return nodes.map { formatText(it) }.join("") } - open fun formatText(text: ContentNode): String { + open fun formatText(node: ContentNode): String { return StringBuilder { - for (node in text.children) { - when (node) { - is ContentText -> append(node.text) - is ContentEmphasis -> append(formatBold(formatText(node.children))) - else -> append(formatText(node.children)) - } + when (node) { + is ContentText -> append(node.text) + is ContentEmphasis -> append(formatBold(formatText(node.children))) + else -> append(formatText(node.children)) } }.toString() } |