added label syntax support and highlighting
This commit is contained in:
1 parent
660a80a26b
commit
26b8370b01
12 files changed
+122
-19
No files matched your search
@@ -20,6 +20,22 @@ import kotlin.test.assertFalse
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class LyngHighlightTest {
|
||||
@Test
|
||||
fun highlightsReturnAndLabels() {
|
||||
val md = """
|
||||
```lyng
|
||||
return 42
|
||||
break@outer null
|
||||
return@fn val
|
||||
```
|
||||
""".trimIndent()
|
||||
val html = renderMarkdown(md)
|
||||
|
||||
assertTrue(html.contains("hl-kw"), "Expected keyword class for 'return': $html")
|
||||
assertTrue(html.contains("hl-lbl") || html.contains("hl-ann"), "Expected label/annotation class for @outer/@fn: $html")
|
||||
assertTrue(html.contains(">>>").xor(true), "Should not contain prompt marker unless expected")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun highlightsLyngFencedBlock() {
|
||||
val md = """
|
||||
|
||||
Reference in new issue
Block a user