diff options
| -rw-r--r-- | core/src/main/kotlin/Java/JavadocParser.kt | 25 | ||||
| -rw-r--r-- | core/src/main/kotlin/Model/Content.kt | 2 | ||||
| -rw-r--r-- | gradle.properties | 2 |
3 files changed, 22 insertions, 7 deletions
diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt index 9a39f2cc..04de2908 100644 --- a/core/src/main/kotlin/Java/JavadocParser.kt +++ b/core/src/main/kotlin/Java/JavadocParser.kt @@ -94,7 +94,9 @@ class JavadocParser( when (tagName) { "param" -> { section.appendTypeElement(signature) { - it.details.find { it.kind == NodeKind.Parameter }?.detailOrNull(NodeKind.Type) + it.details + .find { node -> node.kind == NodeKind.Parameter && node.name == tag.getSubjectName() } + ?.detailOrNull(NodeKind.Type) } } "return" -> { @@ -355,7 +357,21 @@ class JavadocParser( else ContentParagraph() } - "script" -> ScriptBlock(element.attr("type"), element.attr("src")) + "script" -> { + + // If the `type` attr is an empty string, we want to use null instead so that the resulting generated + // Javascript does not contain a `type` attr. + // + // Example: + // type == "" => <script type="" src="..."> + // type == null => <script src="..."> + val type = if (element.attr("type").isNotEmpty()) { + element.attr("type") + } else { + null + } + ScriptBlock(type, element.attr("src")) + } else -> ContentBlock() } @@ -467,10 +483,9 @@ class JavadocParser( } } - // Loads script from CDN, ScriptBlock objects constructs HTML object + // Loads MathJax script from local source, which then updates MathJax HTML code "usesMathJax" -> { - "<script type=\"text/javascript\" async src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/" + - "latest.js?config=TeX-AMS_SVG\"></script>" + "<script src=\"/_static/js/managed/mathjax/MathJax.js?config=TeX-AMS_SVG\"></script>" } else -> tag.text diff --git a/core/src/main/kotlin/Model/Content.kt b/core/src/main/kotlin/Model/Content.kt index 3732547c..f239da7f 100644 --- a/core/src/main/kotlin/Model/Content.kt +++ b/core/src/main/kotlin/Model/Content.kt @@ -104,7 +104,7 @@ object ContentIndentedSoftLineBreak: ContentNode { override val textLength: Int get() = 0 } -class ScriptBlock(val type: String, val src: String) : ContentBlock() +class ScriptBlock(val type: String?, val src: String) : ContentBlock() class ContentParagraph() : ContentBlock() class ContentEmphasis() : ContentBlock() diff --git a/gradle.properties b/gradle.properties index 4d517e4e..7cec8fd6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -dokka_version=0.9.17-g002 +dokka_version=0.9.17-g003 dokka_publication_channel=dokka #Kotlin compiler and plugin |
