From 86fe7de15988ea511fdc5e4f44039154cd236149 Mon Sep 17 00:00:00 2001 From: Antoine Gourlay Date: Mon, 2 May 2016 15:36:09 +0200 Subject: SI-9752 never ignore blank lines when parsing code blocks (#5125) The default behavior when parsing the content of a tag text (like after `@example`) was to ignore empty lines. That's fine, except when we are in the middle of a code block, where preserving formatting matters. --- test/scaladoc/run/t9752.check | 5 +++++ test/scaladoc/run/t9752.scala | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/scaladoc/run/t9752.check create mode 100644 test/scaladoc/run/t9752.scala (limited to 'test/scaladoc') diff --git a/test/scaladoc/run/t9752.check b/test/scaladoc/run/t9752.check new file mode 100644 index 0000000000..daeafb8ecc --- /dev/null +++ b/test/scaladoc/run/t9752.check @@ -0,0 +1,5 @@ +List(Body(List(Paragraph(Chain(List(Summary(Text())))), Code(class A + + +class B)))) +Done. diff --git a/test/scaladoc/run/t9752.scala b/test/scaladoc/run/t9752.scala new file mode 100644 index 0000000000..b11c7f5c32 --- /dev/null +++ b/test/scaladoc/run/t9752.scala @@ -0,0 +1,28 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + override def code = s""" + /** + * Foo + * + * @example + * {{{ + * class A + * + * + * class B + * }}} + */ + object Foo + """ + + def scaladocSettings = "" + + def testModel(root: Package) = { + import access._ + val obj = root._object("Foo") + println(obj.comment.get.example) + } +} -- cgit v1.2.3