diff options
Diffstat (limited to 'src/Formats')
-rw-r--r-- | src/Formats/HtmlFormatService.kt | 2 | ||||
-rw-r--r-- | src/Formats/MarkdownFormatService.kt | 2 | ||||
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/src/Formats/HtmlFormatService.kt b/src/Formats/HtmlFormatService.kt index 751c5d5b..46e4be4a 100644 --- a/src/Formats/HtmlFormatService.kt +++ b/src/Formats/HtmlFormatService.kt @@ -145,6 +145,8 @@ public open class HtmlFormatService(locationService: LocationService, body() to.appendln("</ul>") } + + override fun formatNonBreakingSpace(): String = " " } fun getPageTitle(nodes: Iterable<DocumentationNode>): String? { diff --git a/src/Formats/MarkdownFormatService.kt b/src/Formats/MarkdownFormatService.kt index 2bd12c53..2ea169dd 100644 --- a/src/Formats/MarkdownFormatService.kt +++ b/src/Formats/MarkdownFormatService.kt @@ -117,4 +117,6 @@ public open class MarkdownFormatService(locationService: LocationService, body() to.append(" |") } + + override fun formatNonBreakingSpace(): String = " " } diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index 794b0990..ee835aa0 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -37,6 +37,7 @@ public abstract class StructuredFormatService(locationService: LocationService, public abstract fun formatList(text: String): String public abstract fun formatListItem(text: String): String public abstract fun formatBreadcrumbs(items: Iterable<FormatLink>): String + public abstract fun formatNonBreakingSpace(): String open fun formatText(location: Location, nodes: Iterable<ContentNode>): String { return nodes.map { formatText(location, it) }.join("") @@ -49,6 +50,7 @@ public abstract class StructuredFormatService(locationService: LocationService, is ContentSymbol -> append(formatSymbol(content.text)) is ContentKeyword -> append(formatKeyword(content.text)) is ContentIdentifier -> append(formatIdentifier(content.text)) + is ContentNonBreakingSpace -> append(formatNonBreakingSpace()) is ContentStrong -> append(formatStrong(formatText(location, content.children))) is ContentStrikethrough -> append(formatStrikethrough(formatText(location, content.children))) is ContentCode -> append(formatCode(formatText(location, content.children))) |