From 722c9afcdf43e27ae82b30f8b21a6d0f967a7ee2 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 26 Feb 2015 16:28:05 +0100 Subject: use non-breaking spaces when generating signatures --- src/Formats/HtmlFormatService.kt | 2 ++ src/Formats/MarkdownFormatService.kt | 2 ++ src/Formats/StructuredFormatService.kt | 2 ++ 3 files changed, 6 insertions(+) (limited to 'src/Formats') 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("") } + + override fun formatNonBreakingSpace(): String = " " } fun getPageTitle(nodes: Iterable): 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): String + public abstract fun formatNonBreakingSpace(): String open fun formatText(location: Location, nodes: Iterable): 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))) -- cgit