summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2010-04-12 14:38:16 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2010-04-12 14:38:16 +0000
commit03e6cd14000ef66cb03fd515c454994df06edcb8 (patch)
treeeeaf73343e76a47ef2307f40ae69099cb7384ee9 /src
parent248c72814a359067e3aeef19caf7d69a0d6bd181 (diff)
downloadscala-03e6cd14000ef66cb03fd515c454994df06edcb8.tar.gz
scala-03e6cd14000ef66cb03fd515c454994df06edcb8.tar.bz2
scala-03e6cd14000ef66cb03fd515c454994df06edcb8.zip
[scaladoc] More mitigation code for dangerous H...
[scaladoc] More mitigation code for dangerous HTML tags. No review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala3
-rw-r--r--src/library/scala/native.scala22
2 files changed, 12 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala b/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala
index 198fbcc6f3..dba538046a 100644
--- a/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala
@@ -58,7 +58,7 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory =>
/** Dangerous HTML tags that should be replaced by something safer, such as wiki syntax, or that should be dropped. */
protected val DangerousHtml =
- new Regex("""<(/?(?:p|div|pre|ol|ul|li|h[1-6]))[^>]*>""")
+ new Regex("""<(/?(?:p|div|pre|ol|ul|li|h[1-6]|code))[^>]*>""")
/** Maps a dangerous HTML tag to a safe wiki replacement, or an empty string if it cannot be salvaged. */
protected def htmlReplacement(mtch: Regex.Match): String = mtch.matched match {
@@ -67,6 +67,7 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory =>
case "/h1" | "/h2" | "/h3" | "/h4" | "/h5" | "/h6" => " =\n"
case "pre" => "{{{"
case "/pre" => "}}}"
+ case "code" | "/code" => "`"
case "li" => "\n - "
case _ => ""
}
diff --git a/src/library/scala/native.scala b/src/library/scala/native.scala
index fbacf43b72..8aeffe1632 100644
--- a/src/library/scala/native.scala
+++ b/src/library/scala/native.scala
@@ -11,16 +11,14 @@
package scala
-/**
- * Marker for native methods.
- * <p>
- * <code>@native def f(x: Int, y: List[Long]): String = ..</code>
- * </p>
- * <p>
- * Method body is not generated if method is marked with <code>@native</code>,
- * but it is type checked when present.
- * </p>
- *
- * @since 2.6
- */
+/** Marker for native methods.
+ *
+ * {{{
+ * @native def f(x: Int, y: List[Long]): String = ...
+ * }}}
+ *
+ * Method body is not generated if method is marked with `@native`,
+ * but it is type checked when present.
+ *
+ * @since 2.6 */
class native extends StaticAnnotation {}