diff options
-rw-r--r-- | core/src/main/kotlin/Java/JavadocParser.kt | 1 | ||||
-rw-r--r-- | core/src/main/kotlin/Model/Content.kt | 6 | ||||
-rw-r--r-- | core/src/main/kotlin/javadoc/tags.kt | 7 |
3 files changed, 11 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt index af45f150..c25f5813 100644 --- a/core/src/main/kotlin/Java/JavadocParser.kt +++ b/core/src/main/kotlin/Java/JavadocParser.kt @@ -94,6 +94,7 @@ class JavadocParser(private val refGraph: NodeReferenceGraph, "ol" -> ContentOrderedList() "li" -> ContentListItem() "a" -> createLink(element) + "br" -> ContentBlock().apply { hardLineBreak() } else -> ContentBlock() } diff --git a/core/src/main/kotlin/Model/Content.kt b/core/src/main/kotlin/Model/Content.kt index c8585418..1f5bbc83 100644 --- a/core/src/main/kotlin/Model/Content.kt +++ b/core/src/main/kotlin/Model/Content.kt @@ -89,6 +89,11 @@ abstract class ContentNodeLink() : ContentBlock() { abstract val node: DocumentationNode? } +object ContentHardLineBreak : ContentNode { + override val textLength: Int + get() = 0 +} + class ContentNodeDirectLink(override val node: DocumentationNode): ContentNodeLink() { override fun equals(other: Any?): Boolean = super.equals(other) && other is ContentNodeDirectLink && node.name == other.node.name @@ -153,6 +158,7 @@ fun ContentBlock.identifier(value: String, kind: IdentifierKind = IdentifierKind fun ContentBlock.nbsp() = append(ContentNonBreakingSpace) fun ContentBlock.softLineBreak() = append(ContentSoftLineBreak) fun ContentBlock.indentedSoftLineBreak() = append(ContentIndentedSoftLineBreak) +fun ContentBlock.hardLineBreak() = append(ContentHardLineBreak) fun ContentBlock.strong(body: ContentBlock.() -> Unit) { val strong = ContentStrong() diff --git a/core/src/main/kotlin/javadoc/tags.kt b/core/src/main/kotlin/javadoc/tags.kt index b9ba7382..05d98b71 100644 --- a/core/src/main/kotlin/javadoc/tags.kt +++ b/core/src/main/kotlin/javadoc/tags.kt @@ -217,10 +217,11 @@ private fun buildInlineTags(module: ModuleNodeAdapter, holder: Doc, node: Conten is Content -> { surroundWith(module, holder, "<p>", "</p>", node.summary, result) surroundWith(module, holder, "<p>", "</p>", node.description, result) -// node.sections.forEach { -// buildInlineTags(module, holder, it, result) -// } } + is ContentBlock -> { + surroundWith(module, holder, "", "", node, result) + } + is ContentHardLineBreak -> result.add(TextTag(holder, ContentText("<br/>"))) else -> result.add(TextTag(holder, ContentText("$node"))) } |