forked from gsantner/markor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_nested_formatting_simple.kt
More file actions
47 lines (40 loc) · 1.53 KB
/
test_nested_formatting_simple.kt
File metadata and controls
47 lines (40 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*#######################################################
*
* SPDX-FileCopyrightText: 2025 Milos Vasic
* SPDX-License-Identifier: Apache-2.0
*
* Simple test to understand nested formatting issues
*
*########################################################*/
import digital.vasic.yole.format.markdown.MarkdownParser
fun main() {
val parser = MarkdownParser()
// Test cases for nested formatting
val testCases = listOf(
"*italic with **bold** inside*",
"**bold with *italic* inside**",
"***bold and italic***",
"~~strikethrough with **bold** inside~~",
"`code with *italic* inside`",
"*italic with `code` inside*",
"**bold with `code` inside**",
"~~strikethrough with `code` inside~~"
)
println("Testing nested formatting scenarios:")
println("=".repeat(50))
for (content in testCases) {
println("\nInput: $content")
val document = parser.parse(content)
println("Output: ${document.parsedContent}")
// Check for proper nesting
val hasEm = document.parsedContent.contains("<em>")
val hasStrong = document.parsedContent.contains("<strong>")
val hasCode = document.parsedContent.contains("<code>")
val hasStrike = document.parsedContent.contains("<s>")
println("Contains <em>: $hasEm")
println("Contains <strong>: $hasStrong")
println("Contains <code>: $hasCode")
println("Contains <s>: $hasStrike")
println("-".repeat(30))
}
}