-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
escaped inline formatting, tests for inline formatting, documentation minor grammar changes
- Loading branch information
Showing
6 changed files
with
157 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use unimarkup_rs::{backend::Render, um_elements::ParagraphBlock, um_error::UmError}; | ||
|
||
#[test] | ||
|
||
fn escaped_inline() -> Result<(), UmError> { | ||
let id = String::from("paragraph-id"); | ||
let content = String::from("\\*23\\*3"); | ||
|
||
let mut block = ParagraphBlock { | ||
id: id.clone(), | ||
content, | ||
attributes: "{}".into(), | ||
line_nr: 0, | ||
}; | ||
|
||
let mut expected_html = format!("<p id='{}'>\\*23\\*3</p>", id); | ||
|
||
assert_eq!(expected_html, block.render_html()?); | ||
|
||
block.content = "\\ *italic*\\".to_string(); | ||
expected_html = format!("<p id='{}'>\\ <i>italic</i>\\</p>", id); | ||
assert_eq!(expected_html, block.render_html()?); | ||
|
||
block.content = "**\\*only bold\\***".to_string(); | ||
expected_html = format!("<p id='{}'><b>\\*only bold\\*</b></p>", id); | ||
assert_eq!(expected_html, block.render_html()?); | ||
|
||
Ok(()) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,5 @@ mod um_elements { | |
|
||
mod backend { | ||
mod backend_run; | ||
mod inline_tests; | ||
} |