diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 2 | ||||
-rw-r--r-- | src/Kotlin/ContentBuilder.kt | 4 | ||||
-rw-r--r-- | src/Model/Content.kt | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index cc551eb4..0e01db4d 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -32,6 +32,7 @@ public abstract class StructuredFormatService(locationService: LocationService, public abstract fun formatSymbol(text: String): String public abstract fun formatKeyword(text: String): String public abstract fun formatIdentifier(text: String, kind: IdentifierKind): String + public fun formatEntity(text: String): String = text public abstract fun formatLink(text: String, href: String): String public open fun formatLink(link: FormatLink): String = formatLink(formatText(link.text), link.href) public abstract fun formatStrong(text: String): String @@ -56,6 +57,7 @@ public abstract class StructuredFormatService(locationService: LocationService, is ContentKeyword -> append(formatKeyword(content.text)) is ContentIdentifier -> append(formatIdentifier(content.text, content.kind)) is ContentNonBreakingSpace -> append(formatNonBreakingSpace()) + is ContentEntity -> append(formatEntity(content.text)) is ContentStrong -> append(formatStrong(formatText(location, content.children))) is ContentStrikethrough -> append(formatStrikethrough(formatText(location, content.children))) is ContentCode -> append(formatCode(formatText(location, content.children))) diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt index 8e75e473..cc519ee6 100644 --- a/src/Kotlin/ContentBuilder.kt +++ b/src/Kotlin/ContentBuilder.kt @@ -102,6 +102,10 @@ public fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver parent.append(nodeStack.pop()) } + MarkdownTokenTypes.HTML_ENTITY -> { + parent.append(ContentEntity(node.text)) + } + MarkdownTokenTypes.TEXT, MarkdownTokenTypes.COLON, MarkdownTokenTypes.DOUBLE_QUOTE, diff --git a/src/Model/Content.kt b/src/Model/Content.kt index d9c3d139..b9d67d5b 100644 --- a/src/Model/Content.kt +++ b/src/Model/Content.kt @@ -37,6 +37,7 @@ public data class ContentText(val text: String) : ContentNode() public data class ContentKeyword(val text: String) : ContentNode() public data class ContentIdentifier(val text: String, val kind: IdentifierKind = IdentifierKind.Other) : ContentNode() public data class ContentSymbol(val text: String) : ContentNode() +public data class ContentEntity(val text: String) : ContentNode() public object ContentNonBreakingSpace: ContentNode() public class ContentParagraph() : ContentBlock() |