forked from scala/scala
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#5728 from Philippus/issue/html-tag-in-hover
inlineToStr is not exhaustive and does not remove html tags inside HtmlTag [ci: last-only]
- Loading branch information
Showing
6 changed files
with
90 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Chain(List(Chain(List(Text(This comment contains ), Superscript(Text(superscript)))))) | ||
Chain(List(Chain(List(Text(This comment contains ), Subscript(Text(subscript)))))) | ||
Chain(List(Chain(List(Text(This comment contains a link ), Link(https://scala.epfl.ch/,Text(https://scala.epfl.ch/)))))) | ||
Chain(List(Chain(List(Text(This comment contains an ), HtmlTag(<strong>html tag</strong>))))) | ||
Chain(List(Chain(List(Text(This comment contains a), HtmlTag(<br>), Text( single html tag))))) | ||
Chain(List(Chain(List(Text(This comment contains nested ), HtmlTag(<strong>html<br> tags</strong>))))) | ||
This comment contains superscript | ||
This comment contains subscript | ||
This comment contains a link https://scala.epfl.ch/ | ||
This comment contains an html tag | ||
This comment contains a single html tag | ||
This comment contains nested html tags | ||
Done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import scala.tools.nsc.doc.html.Page | ||
import scala.tools.nsc.doc.model._ | ||
import scala.tools.partest.ScaladocModelTest | ||
|
||
object Test extends ScaladocModelTest { | ||
|
||
override def code = """ | ||
/** This comment contains ^superscript^ */ | ||
class Foo { | ||
/** This comment contains ,,subscript,, */ | ||
def bar = ??? | ||
/** This comment contains a link [[https://scala.epfl.ch/]] */ | ||
def baz = ??? | ||
/** This comment contains an <strong>html tag</strong> */ | ||
def qux = ??? | ||
/** This comment contains a<br> single html tag */ | ||
def quux = ??? | ||
/** This comment contains nested <strong>html<br> tags</strong> */ | ||
def quuz = ??? | ||
} | ||
""" | ||
def scaladocSettings = "" | ||
|
||
def testModel(root: Package) = { | ||
import scala.tools.nsc.doc.base.comment._ | ||
import access._ | ||
|
||
val foo = root._class("Foo") | ||
val bar = foo._method("bar") | ||
val baz = foo._method("baz") | ||
val qux = foo._method("qux") | ||
val quux = foo._method("quux") | ||
val quuz = foo._method("quuz") | ||
println(foo.comment.get.short) | ||
println(bar.comment.get.short) | ||
println(baz.comment.get.short) | ||
println(qux.comment.get.short) | ||
println(quux.comment.get.short) | ||
println(quuz.comment.get.short) | ||
println(Page.inlineToStr(foo.comment.get.short)) | ||
println(Page.inlineToStr(bar.comment.get.short)) | ||
println(Page.inlineToStr(baz.comment.get.short)) | ||
println(Page.inlineToStr(qux.comment.get.short)) | ||
println(Page.inlineToStr(quux.comment.get.short)) | ||
println(Page.inlineToStr(quuz.comment.get.short)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters