Skip to content

Scala3doc: quick Wiki syntax fixes #10422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions scala3doc/src/dotty/dokka/tasty/comments/wiki/Converter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,21 @@ class Converter(val repr: Repr) extends BaseConverter {

case Superscript(i) =>
def name = inl.getClass.getSimpleName
println(s"WARN: not yet supported: $name")
println(s"WARN: Wiki syntax tag not yet fully supported: $name")
emitInline(i)

case Subscript(i) =>
def name = inl.getClass.getSimpleName
println(s"WARN: not yet supported: $name")
println(s"WARN: Wiki syntax tag not yet fully supported: $name")
emitInline(i)

case _: (RepresentationLink | HtmlTag) =>
def name = inl.getClass.getSimpleName
println(s"WARN: not yet supported: $name")
name // doesn't compile if name is a val
case HtmlTag(content) =>
emit(dkkd.Html(List(dkk.text(content)).asJava, kt.emptyMap))

case _: RepresentationLink =>
val name = inl.getClass.getSimpleName
println(s"WARN: Wiki syntax tag not yet supported: $name")
emit(dkk.text(name))
}

def convertInline(inl: Inline): Seq[dkkd.DocTag] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ object ScalaCommentToContentConverter extends DocTagToContentConverter {
title = docTag.getParams.asScala.get("title")
))
List(res).asJava
case h: Html => List(
HtmlContentNode(
h.getChildren.asScala.collect{case c: Text => c}.head.getBody,
dci,
sourceSets.asScala.toSet.toDisplay.asScala.toSet,
styles.asScala.toSet
)
).asJava

case h: Html =>
val children = h.getChildren
require(children.size() == 1)
require(children.get(0).isInstanceOf[Text])
List(
HtmlContentNode(
children.get(0).asInstanceOf[Text].getBody,
dci,
sourceSets.asScala.toSet.toDisplay.asScala.toSet,
styles.asScala.toSet
)
).asJava
case other => super.buildContent(other, dci, sourceSets, styles, extra)
}

Expand Down