diff options
author | Robert Stoll <rstoll@tutteli.ch> | 2018-06-22 10:25:09 +0200 |
---|---|---|
committer | Simon Ogorodnik <simon.ogorodnik@gmail.com> | 2018-07-16 20:10:57 +0300 |
commit | 17dd9747828a2ba8275714dc421a415c68d01615 (patch) | |
tree | 68e469190a91499e30216c33267a11089ad7e92a /core/src | |
parent | dcd84d619665864b275591c93248f4637f6ee636 (diff) | |
download | dokka-17dd9747828a2ba8275714dc421a415c68d01615.tar.gz dokka-17dd9747828a2ba8275714dc421a415c68d01615.tar.bz2 dokka-17dd9747828a2ba8275714dc421a415c68d01615.zip |
convert line separators in PackageDocs, fixes PackageDocsTest
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/Model/PackageDocs.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Model/PackageDocs.kt b/core/src/main/kotlin/Model/PackageDocs.kt index 1f6bdcb9..bb8e98d1 100644 --- a/core/src/main/kotlin/Model/PackageDocs.kt +++ b/core/src/main/kotlin/Model/PackageDocs.kt @@ -2,6 +2,7 @@ package org.jetbrains.dokka import com.google.inject.Inject import com.google.inject.Singleton +import com.intellij.openapi.util.text.StringUtil import org.intellij.markdown.MarkdownElementTypes import org.intellij.markdown.MarkdownTokenTypes import org.intellij.markdown.parser.LinkMap @@ -21,7 +22,7 @@ class PackageDocs fun parse(fileName: String, linkResolveContext: List<PackageFragmentDescriptor>) { val file = File(fileName) if (file.exists()) { - val text = file.readText() + val text = StringUtil.convertLineSeparators(file.readText()) val tree = parseMarkdown(text) val linkMap = LinkMap.buildLinkMap(tree.node, text) var targetContent: MutableContent = moduleContent @@ -51,7 +52,7 @@ class PackageDocs } private fun findOrCreatePackageContent(packageName: String) = - _packageContent.getOrPut(packageName) { -> MutableContent() } + _packageContent.getOrPut(packageName) { MutableContent() } private fun resolveContentLink(fileName: String, href: String, linkResolveContext: List<PackageFragmentDescriptor>): ContentBlock { if (linkResolver != null) { |