Emphasis test

issue1
Alex Bethel 2021-11-27 21:29:10 -07:00
parent 2b6e6746f9
commit 71c9249916
1 changed files with 52 additions and 0 deletions

View File

@ -145,4 +145,56 @@ New paragraph",
assert_eq!(doc, doc_ref);
}
/// Italics and bold.
#[test]
fn emphasis() {
let doc = parse("Normal *italics* **bold** ***both***");
let doc_ref = Document(vec![Node::Paragraph(vec![
StyledText {
italic: false,
bold: false,
underline: false,
color: None,
text: "Normal ".to_string(),
},
StyledText {
italic: true,
bold: false,
underline: false,
color: None,
text: "italics".to_string(),
},
StyledText {
italic: false,
bold: false,
underline: false,
color: None,
text: " ".to_string(),
},
StyledText {
italic: false,
bold: true,
underline: false,
color: None,
text: "bold".to_string(),
},
StyledText {
italic: false,
bold: false,
underline: false,
color: None,
text: " ".to_string(),
},
StyledText {
italic: true,
bold: true,
underline: false,
color: None,
text: "both".to_string(),
},
])]);
assert_eq!(doc, doc_ref);
}
}