diff --git a/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala b/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala index bab81b96..c4e9ec26 100644 --- a/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala +++ b/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala @@ -310,8 +310,8 @@ abstract class ApiDocDirective(name: String) } object ApiDocDirective { - /** This relies on the naming convention of packages being all-lowercase (which is rarely broken). */ - def packageDotsToSlash(s: String) = s.replaceAll("(\\b[a-z]+)\\.", "$1/") + /** This relies on the naming convention of packages being all-ascii-lowercase (which is rarely broken), numbers and underscore. */ + def packageDotsToSlash(s: String) = s.replaceAll("(\\b[a-z][a-z0-9_]*)\\.", "$1/") } case class ScaladocDirective(ctx: Writer.Context) diff --git a/tests/src/test/scala/com/lightbend/paradox/markdown/ScaladocDirectiveSpec.scala b/tests/src/test/scala/com/lightbend/paradox/markdown/ScaladocDirectiveSpec.scala index 4123f6bd..ec9ab1e6 100644 --- a/tests/src/test/scala/com/lightbend/paradox/markdown/ScaladocDirectiveSpec.scala +++ b/tests/src/test/scala/com/lightbend/paradox/markdown/ScaladocDirectiveSpec.scala @@ -35,6 +35,11 @@ class ScaladocDirectiveSpec extends MarkdownBaseSpec { html("""
""") } + it should "create accept digits in package names" in { + markdown("@scaladoc[ObjectMetadata](akka.s3.ObjectMetadata)") shouldEqual + html("""""") + } + it should "support 'scaladoc:' as an alternative name" in { markdown("@scaladoc:[Model](org.example.Model)") shouldEqual html("""""")