File: styles.rs

package info (click to toggle)
rust-html2md 0.2.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 484 kB
  • sloc: makefile: 2
file content (32 lines) | stat: -rw-r--r-- 849 bytes parent folder | download
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
extern crate html2md;

use html2md::parse_html;
use pretty_assertions::assert_eq;

#[test]
fn test_styles_with_spaces() {
    let md = parse_html(r#"It read:<s> Nobody will ever love you</s>"#);
    assert_eq!(md, r#"It read: ~~Nobody will ever love you~~"#)
}

#[test]
fn test_styles_with_newlines() {
    let md = parse_html(r#"
And she said:<br/>
<s>We are all just prisoners here<br/>
<u> Of our own device<br/>  </s>
And in the master's chambers<br/>
They gathered for the feast<br/>
<em>They stab it with their steely knives</em><br/>
<strong>But they just can't kill the beast<br/></strong>
    
"#);
    assert_eq!(md, "\
And she said:  
~~We are all just prisoners here  
 Of our own device~~  
And in the master's chambers  
They gathered for the feast  
*They stab it with their steely knives*  
**But they just can't kill the beast**")
}