diff --git a/src/lib.rs b/src/lib.rs index 2239496..4c6e617 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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); + } }