Add a test for the table div-wrapping

This commit is contained in:
Jade 2021-07-30 01:17:02 -07:00 committed by Jade Lovelace
parent 85df785cd3
commit 89b580ab52
1 changed files with 16 additions and 0 deletions

View File

@ -257,6 +257,22 @@ mod tests {
); );
} }
#[test]
fn it_can_wrap_tables() {
let src = r#"
| Original | Punycode | Punycode + Encoding |
|-----------------|-----------------|---------------------|
| føø | f-5gaa | f_5gaa |
"#;
let out = r#"
<div class="table-wrapper"><table><thead><tr><th>Original</th><th>Punycode</th><th>Punycode + Encoding</th></tr></thead><tbody>
<tr><td>føø</td><td>f-5gaa</td><td>f_5gaa</td></tr>
</tbody></table>
</div>
"#.trim();
assert_eq!(render_markdown(src, false), out);
}
#[test] #[test]
fn it_can_keep_quotes_straight() { fn it_can_keep_quotes_straight() {
assert_eq!(render_markdown("'one'", false), "<p>'one'</p>\n"); assert_eq!(render_markdown("'one'", false), "<p>'one'</p>\n");