From e64cb9bfbef093bcc4046a5081393f3c9778b42a Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Mon, 24 Aug 2020 10:43:10 +0200 Subject: Fix losing tokens while parsing markdown italic text --- .../base/src/test/kotlin/markdown/ParserTest.kt | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'plugins/base/src/test') diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt index ee6170c2..838233eb 100644 --- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt +++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt @@ -166,6 +166,54 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } + @Test + fun `Stars as italic bounds`() { + val kdoc = "The abstract syntax tree node for a multiplying expression. A multiplying\n" + + "expression is a binary expression where the operator is a multiplying operator\n" + + "such as \"*\", \"/\", or \"mod\". A simple example would be \"5*x\"." + val expectedDocumentationNode = DocumentationNode( + listOf( + Description( + P( + listOf( + Text("The abstract syntax tree node for a multiplying expression. A multiplying " + + "expression is a binary expression where the operator is a multiplying operator " + + "such as \"" + ), + I(listOf(Text("\", \"/\", or \"mod\". A simple example would be \"5"))), + Text("x\".") + ) + ) + ) + ) + ) + executeTest(kdoc, expectedDocumentationNode) + } + + @Test + fun `Stars as bold bounds`() { + val kdoc = "The abstract syntax tree node for a multiplying expression. A multiplying\n" + + "expression is a binary expression where the operator is a multiplying operator\n" + + "such as \"**\", \"/\", or \"mod\". A simple example would be \"5**x\"." + val expectedDocumentationNode = DocumentationNode( + listOf( + Description( + P( + listOf( + Text("The abstract syntax tree node for a multiplying expression. A multiplying " + + "expression is a binary expression where the operator is a multiplying operator " + + "such as \"" + ), + B(listOf(Text("\", \"/\", or \"mod\". A simple example would be \"5"))), + Text("x\".") + ) + ) + ) + ) + ) + executeTest(kdoc, expectedDocumentationNode) + } + @Test fun `Embedded star`() { val kdoc = "Embedded*Star" -- cgit