From b4344e121c7e195f5244cd704d5296274d503dd1 Mon Sep 17 00:00:00 2001 From: Kato Kazuyoshi Date: Wed, 20 Mar 2013 00:55:06 +0900 Subject: SI-6580 Scaladoc: Should not close void elements Because it will generate a useless element like "". To made matters worse, Scaladoc used to generate the element with attributes (like ). That's why we had SI-6580. --- .../scala/tools/nsc/doc/base/comment/Body.scala | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/doc/base/comment/Body.scala b/src/compiler/scala/tools/nsc/doc/base/comment/Body.scala index 02e662da85..eb0d751f3e 100755 --- a/src/compiler/scala/tools/nsc/doc/base/comment/Body.scala +++ b/src/compiler/scala/tools/nsc/doc/base/comment/Body.scala @@ -75,16 +75,20 @@ object EntityLink { def unapply(el: EntityLink): Option[(Inline, LinkTo)] = Some((el.title, el.link)) } final case class HtmlTag(data: String) extends Inline { - def canClose(open: HtmlTag) = { - open.data.stripPrefix("<") == data.stripPrefix("].*\z""".r + private val (isEnd, tagName) = data match { + case Pattern(s1, s2) => + (! s1.isEmpty, Some(s2.toLowerCase)) + case _ => + (false, None) } - def close = { - if (data.indexOf(" HtmlTag(s"") } } /** The summary of a comment, usually its first sentence. There must be exactly one summary per body. */ -- cgit v1.2.3