Skip to content

Commit 1da78bd

Browse files
committed
Add a test for the table div-wrapping
1 parent c944481 commit 1da78bd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/utils/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,22 @@ mod tests {
331331
);
332332
}
333333

334+
#[test]
335+
fn it_can_wrap_tables() {
336+
let src = r#"
337+
| Original | Punycode | Punycode + Encoding |
338+
|-----------------|-----------------|---------------------|
339+
| føø | f-5gaa | f_5gaa |
340+
"#;
341+
let out = r#"
342+
<div class="table-wrapper"><table><thead><tr><th>Original</th><th>Punycode</th><th>Punycode + Encoding</th></tr></thead><tbody>
343+
<tr><td>føø</td><td>f-5gaa</td><td>f_5gaa</td></tr>
344+
</tbody></table>
345+
</div>
346+
"#.trim();
347+
assert_eq!(render_markdown(src, false), out);
348+
}
349+
334350
#[test]
335351
fn it_can_keep_quotes_straight() {
336352
assert_eq!(render_markdown("'one'", false), "<p>'one'</p>\n");

0 commit comments

Comments
 (0)