Kazik Pogoda
05/08/2026, 7:07 PMAnonymike
05/08/2026, 7:45 PMAnonymike
05/08/2026, 7:46 PMKazik Pogoda
05/08/2026, 8:01 PMaltavir
05/10/2026, 5:49 AMKazik Pogoda
05/10/2026, 6:58 PM@Test
fun `should parse table`() = runTest {
// given
val textFlow = """
| Column 1 | Column 2 |
|----------|----------|
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |
""".trimIndent().chunkedRandomly().asFlow()
// when
val parsed = textFlow.parse()
// then
parsed.mergeAdjacentText() sameAs semanticEvents {
"table" {
"thead" {
"tr" {
"th" { +"Column 1" }
"th" { +"Column 2" }
}
}
"tbody" {
"tr" {
"td" { +"Cell 1" }
"td" { +"Cell 2" }
}
"tr" {
"td" { +"Cell 3" }
"td" { +"Cell 4" }
}
}
}
}
}
https://github.com/xemantic/markanywhere/blob/37106520a31aaded08ccb5dad587fe3b83645787/markanywhere-parse/src/commonTest/kotlin/MarkanywhereParserTest.kt#L960
Something else than this?Kazik Pogoda
05/10/2026, 7:01 PMKazik Pogoda
05/10/2026, 7:02 PMaltavir
05/11/2026, 5:25 AMaltavir
05/11/2026, 6:37 AMKazik Pogoda
05/11/2026, 9:17 AMaltavir
05/11/2026, 9:49 AM